https://github.com/kosso/applauncher-issue
Sample iOS and Android CapacitorJS app to demonstrate app-launcher plugin issue 1744 : https://github.com/ionic-team/capacitor-plugins/issues/1744
https://github.com/kosso/applauncher-issue
Last synced: 2 months ago
JSON representation
Sample iOS and Android CapacitorJS app to demonstrate app-launcher plugin issue 1744 : https://github.com/ionic-team/capacitor-plugins/issues/1744
- Host: GitHub
- URL: https://github.com/kosso/applauncher-issue
- Owner: kosso
- Created: 2023-08-18T13:29:15.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-18T17:15:14.000Z (almost 2 years ago)
- Last Synced: 2025-02-14T01:18:48.651Z (4 months ago)
- Language: Swift
- Size: 643 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Sample iOS & Android app to demonstrate an issue with the capacitor/app-launcer plugin on Android
See the issue here : [https://github.com/ionic-team/capacitor-plugins/issues/1744](https://github.com/ionic-team/capacitor-plugins/issues/1744)
-----------------
#### sample app id
`com.kosso.applauncherissue`
- To test this app, please ensure you have both the Twitter/X & Facebook apps installed on iOS and Android test devices.
This sample app will use the documented `AppLauncher.canOpenUrl()` method to test to see if the Twitter/X and Facebook apps are installed on iOS and Android. The results are shown in the app window.
To do this, we test for the URLs : `twitter://timeline` and `fb://feed`.
The test JS code resides in `./js/test-app.js`
#### Results (with both Twitter and Facebook apps installed on the devices)
---------------------
#### Result iOS---------------------
#### Result Android
---------------------
## Bug Report
### Plugin(s)
`app-launcher`
### Capacitor Version
```
Latest Dependencies:@capacitor/cli: 5.2.3
@capacitor/core: 5.2.3
@capacitor/android: 5.2.3
@capacitor/ios: 5.2.3Installed Dependencies:
@capacitor/cli: 5.2.2
@capacitor/android: 5.2.2
@capacitor/core: 5.2.2
@capacitor/ios: 5.2.2[success] iOS looking great! 👌
[success] Android looking great! 👌
```### 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 the `LSApplicationQueriesSchemes` to Info.plist containing an array of strings including `twitter` and `fb`.)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
```
import { AppLauncher } from '@capacitor/app-launcher';AppLauncher.canOpenUrl({ url: 'twitter://timeline' }).then(data => {
console.log('AppLauncher : Is Twitter/X installed? ', data.value);
});AppLauncher.canOpenUrl({ url: 'fb://feed' }).then(data => {
console.log('AppLauncher : Is Facebook installed? ', data.value);
});
```