Closed OrenMe closed 9 months ago
any update on this? is this expected?
Maybe this can be helpful. https://developer.android.com/training/package-visibility/declaring#package-name
Basically you have to declare your package visibility as well. Otherwise canOpenUrl
always returns true.
<manifest>
<queries>
<package android:name="com.example.store" /> <-- package name of the app that you want to access-->
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="scheme"/>
</intent>
</queries>
</manifest>
Unsure if this is related, but it also always appears to return true for Android App Links on API levels 28, 29 and 30.
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
any update on this?
Description
When trying to check of a universal link is supported or can be open on AndroidTV the call to canOpenURL always returns true, no matter if there is an app to open it or not and calling openURL doesn't fail even if there is no app to support it and a notification appears at bottom of screen saying "you don't have an app that can do this"
I would expect it to fail on universal links as there is no browser to open these urls and only if there is an app that registers them and support them it will return true. The use case is that I want to try and open an app with its supported universal link and if not supported cause it is not installed so direct to the store.
Version
0.70.6
Output of
npx react-native info
System: OS: macOS 13.0.1 CPU: (10) arm64 Apple M1 Pro Memory: 76.34 MB / 32.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node Yarn: 1.22.19 - ~/.yarn/bin/yarn npm: 8.10.0 - ~/.nvm/versions/node/v16.14.0/bin/npm Watchman: 2022.07.04.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1 Android SDK: API Levels: 28, 29, 30, 31, 32, 33 Build Tools: 30.0.2, 30.0.3, 32.0.0, 32.1.0, 33.0.0 System Images: android-23 | Android TV ARM EABI v7a, android-30 | Android TV Intel x86 Atom, android-30 | ARM 64 v8a, android-30 | Intel x86 Atom_64, android-30 | Google TV Intel x86 Atom, android-30 | Google APIs ARM 64 v8a, android-31 | Android TV ARM 64 v8a, android-31 | Android TV Intel x86 Atom, android-32 | Google APIs ARM 64 v8a, android-33 | Android TV ARM 64 v8a, android-33 | Google APIs ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 14.1/14B47b - /usr/bin/xcodebuild Languages: Java: 11.0.11 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.6 => 0.70.6 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
npx react-native init testLinking
cd testLinking
npx react-native start
App
Linking.openURL('https://google.com') .then(x => console.info('openURL success', x)) .catch(e => console.info('openURL failed', e))