Open kosso opened 1 year ago
This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed.
Please see the Contributing Guide for how to create a Sample App.
Thanks! Ionitron 💙
I have provided a simple code sample above.
Please also refer to the Example Code provided in the actual documentation for this official plugin.
Simply replace the URLs with the ones that I have clearly provided above.
Sorry, but I do not understand what else you need?
This plugin does not work as documented, as I have clearly explained above.
(The documentation fails to even mention the additions to Info.plist I had to add for this to work on iOS)
I can't believe how many hours I've wasted trying to make this work as documented.
we need a full sample app that we can build and run to reproduce the issue
the additions to the Info.plist
are documented here
Please find a full sample app here
https://github.com/kosso/applauncher-issue
This is built for iOS and Android and will demonstrate that the iOS version works and the Android version doesn't.
Additional information and testing a new method :
I have had a go at creating an internal custom 'Utils' plugin for Android to try a different method than the way that the app-launcher
plugin tries to perform canOpenUrl()
...
.. and it works!
Please see the custom-utils-test
branch of my sample app for testing and reference here :
https://github.com/kosso/applauncher-issue/tree/custom-utils-test
Here is the source to my test 'Utils' Android plugin, containing a method canOpenURLTest()
This issue has been labeled as type: bug
. This label is added to issues that that have been reproduced and are being tracked in our internal issue tracker.
Same problem here. CanOpenUrl only works with a package name on Android.
I would like to see this bug fixed in the plugin as well. But I won't have my hopes up, because it was requested multiple times already and not fixed once.
What is more surprising that openUrl()
works fine for me. It's just that canOpenUrl()
returns false
.
For anyone stumbling on this, you can use cordova-plugin-app-launcher
instead.
I can confirm that if you modify the reproduction app to:
AppLauncher.canOpenUrl({ url: 'com.twitter.android' })
rather than:
AppLauncher.canOpenUrl({ url: 'twitter://timeline' })
it will correctly detect Twitter (X).
And for Facebook:
Launcher.canOpenUrl({ url: 'com.facebook.katana' })
rather than:
AppLauncher.canOpenUrl({ url: 'fb://feed' })
Bug Report
Plugin(s)
app-launcher
Capacitor Version
Platform(s)
Android
Current Behavior
I need to test if the Twitter/X and Facebook apps are installed.
On iOS, the code provided below works as expected and returns
true
if both apps are installed. (In order to make this work on iOS, I also needed to add theLSApplicationQueriesSchemes
to Info.plist containing an array of strings includingtwitter
andfb
.)On Android however, the code below returns
false
for both apps, despite them being installed.I have tried adding the required entries to AndroidManifest.xml to allow querying the packages:
I have also tried adding this permission :
Expected Behavior
I expect the result to be
true
when the apps are installed on the device.What am I missing?
Code Reproduction