diff --git a/android/build.gradle b/android/build.gradle index 53a1a73..e58489f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,23 +1,22 @@ apply plugin: "com.android.library" android { - compileSdkVersion 25 - buildToolsVersion "25.0.1" + compileSdkVersion 28 + buildToolsVersion "28.0.3" defaultConfig { minSdkVersion 16 - targetSdkVersion 23 + targetSdkVersion 28 versionCode 1 versionName "1.0" } } dependencies { - compile "com.facebook.react:react-native:+" // From node_modules - compile 'com.android.support:customtabs:25.0.1' - compile ('com.github.droibit.customtabslauncher:launcher:1.0.8') { + implementation 'com.facebook.react:react-native:+' // From node_modules + implementation 'androidx.browser:browser:1.0.0' + implementation('com.github.droibit.customtabslauncher:launcher:1.4.0') { exclude module: 'customtabs' } - - testCompile 'junit:junit:4.12' -} \ No newline at end of file + testImplementation 'junit:junit:4.12' +} diff --git a/android/src/main/java/com/github/droibit/android/reactnative/customtabs/CustomTabsModule.java b/android/src/main/java/com/github/droibit/android/reactnative/customtabs/CustomTabsModule.java index 957c3ca..bbe368d 100644 --- a/android/src/main/java/com/github/droibit/android/reactnative/customtabs/CustomTabsModule.java +++ b/android/src/main/java/com/github/droibit/android/reactnative/customtabs/CustomTabsModule.java @@ -6,10 +6,11 @@ import android.content.Intent; import android.os.Bundle; import android.provider.Browser; -import android.support.customtabs.CustomTabsIntent; import android.text.TextUtils; +import androidx.browser.customtabs.CustomTabsIntent; import com.droibit.android.customtabs.launcher.CustomTabsLauncher; + import com.facebook.react.bridge.JSApplicationIllegalArgumentException; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; @@ -103,7 +104,7 @@ public void openURL(String url, ReadableMap option, Promise promise) { ); final Activity activity = getCurrentActivity(); if (activity != null) { - CustomTabsLauncher.launch(activity, customTabsIntent, url); + CustomTabsLauncher.launch(activity, customTabsIntent, android.net.Uri.parse(url)); promise.resolve(true); } else { promise.resolve(false); diff --git a/package.json b/package.json index d0b3836..f77f12d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-custom-tabs", - "version": "0.1.7", + "version": "0.1.8", "description": "Chrome Custom Tabs for React Native.", "keywords": [ "react-native",