Skip to content

Commit 6023f81

Browse files
committed
Use AndroidX CustomTabsService
1 parent e67b741 commit 6023f81

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

android/src/main/java/io/swan/rnbrowser/helpers/CustomTabsHelper.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import android.text.TextUtils;
2626
import android.util.Log;
2727

28+
import androidx.browser.customtabs.CustomTabsService;
29+
2830
import java.util.ArrayList;
2931
import java.util.List;
3032

@@ -37,8 +39,6 @@ public class CustomTabsHelper {
3739
static final String BETA_PACKAGE = "com.chrome.beta";
3840
static final String DEV_PACKAGE = "com.chrome.dev";
3941
static final String LOCAL_PACKAGE = "com.google.android.apps.chrome";
40-
private static final String ACTION_CUSTOM_TABS_CONNECTION =
41-
"android.support.customtabs.action.CustomTabsService";
4242

4343
private static String sPackageNameToUse;
4444

@@ -71,7 +71,7 @@ public static String getPackageNameToUse(Context context) {
7171
List<String> packagesSupportingCustomTabs = new ArrayList<>();
7272
for (ResolveInfo info : resolvedActivityList) {
7373
Intent serviceIntent = new Intent();
74-
serviceIntent.setAction(ACTION_CUSTOM_TABS_CONNECTION);
74+
serviceIntent.setAction(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION);
7575
serviceIntent.setPackage(info.activityInfo.packageName);
7676
if (pm.resolveService(serviceIntent, 0) != null) {
7777
packagesSupportingCustomTabs.add(info.activityInfo.packageName);

example/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.1",
44
"private": true,
55
"engines": {
6-
"node": ">=18"
6+
"node": "^22"
77
},
88
"scripts": {
99
"clean": "rm -rf ./node_modules ./ios/Pods",

0 commit comments

Comments
 (0)