diff --git a/Libraries/Linking/Linking.js b/Libraries/Linking/Linking.js index 309ce5824be261..bcb885b0a9c50a 100644 --- a/Libraries/Linking/Linking.js +++ b/Libraries/Linking/Linking.js @@ -57,13 +57,6 @@ class Linking extends NativeEventEmitter { * See https://facebook.github.io/react-native/docs/linking.html#openurl */ openURL(url: string): Promise { - // Android Intent requires protocols http and https to be in lowercase. - // https:// and http:// works, but Https:// and Http:// doesn't. - if (url.toLowerCase().startsWith('https://')) { - url = url.replace(url.substr(0, 8), 'https://'); - } else if (url.toLowerCase().startsWith('http://')) { - url = url.replace(url.substr(0, 7), 'http://'); - } this._validateURL(url); return LinkingManager.openURL(url); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java index 6187c943e27e45..a7b84825881b46 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/intent/IntentModule.java @@ -79,7 +79,7 @@ public void openURL(String url, Promise promise) { try { Activity currentActivity = getCurrentActivity(); - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url).normalizeScheme()); String selfPackageName = getReactApplicationContext().getPackageName(); ComponentName componentName = intent.resolveActivity(