GeekyAnts / external_app_launcher

BSD 3-Clause "New" or "Revised" License
14 stars 31 forks source link

Always redirecting to iOS App Store #4

Closed bismarabia closed 2 years ago

bismarabia commented 2 years ago

I have defined random scheme in Project 1 (left side), called it 'dashboss' and tried to use this plugin to check for being installed and launch it.

image

But I am unable to launch the app and it keeps saying Redirecting to AppStore as the app is not present on the device

What could be the issue?

sarika01 commented 2 years ago

Have you added <key>LSApplicationQueriesSchemes</key> <array> <string>dashboss</string> // url scheme name of the app </array>

in the info.plist file?

bismarabia commented 2 years ago

Yes I did @sarika01

but still getting this the following logs

flutter: installed -> 0
flutter: App not found in the device
bismarabia commented 2 years ago

@sarika01 all of the tests are done in the simulator btw...

bismarabia commented 2 years ago

@sarika01 any update on this? I need this for an urgent task...

GayathrideviGA commented 2 years ago

@bismarabia Can you check for ios app store link once ?

Also try to set openStore:false In main.dart file and test the case.

bismarabia commented 2 years ago

@GayathrideviGA @sarika01

it still says flutter: App not found in the device

this is from the app I want to launch.

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>pulsesecure</string>
</array>

and this is from the app I'm launching from

await LaunchApp.openApp(
    androidPackageName: '{packageID}',
    iosUrlScheme: 'pulsesecure://',
    openStore: false,
);

I tried this in iOS from a simulator (debug mode).

bismarabia commented 2 years ago

@sarika01 @GayathrideviGA any update on this?

Gayathri-GA commented 2 years ago

@bismarabia Try to check the case with a real device as some times simulator could not able to open up App Store link it results app not found exception. Also it seems it works well with android device so try to debug it with real device with openStore: true .

The code should be like,

 await LaunchApp.openApp(
                      androidPackageName: 'net.pulsesecure.pulsesecure',
                      iosUrlScheme: 'pulsesecure://',
                      appStoreLink:
                          'https://apps.apple.com/in/app/pulse-secure/id945832041',
                      openStore: true);
keylinwu-wmg commented 2 years ago

@GayathrideviGA This issue keeps happening, seems like the library is only working Android, but not working on iOS. @bismarabia Were you able to fix it in the end, I would really appreciate some help on this, otherwise, I will need to find another library :/

bismarabia commented 2 years ago

Hi @keylinwu-wmg

It works fine on Android. I tested it.... for iPhone. it doesn't work on simulator at all. I tested it on a real iPhone release mode and it always directs to AppStore even thought the app is installed.

For me, it's ok, at least at this point, I'm gonna leave it like this since the user can open the app from AppStore, it will say "OPEN" if installed, "GET" otherwise.

Looking forward to seeing a fix for this issue. @jaiswalshubham84 @Gayathri-GA

kha1989led commented 2 years ago

To overcome this issue, I'm using this package (2.0.2) along with url_launcher 6.0.18:

if (Platform.isAndroid) {
  if (await LaunchApp.isAppInstalled(androidPackageName: appId)) {
    await LaunchApp.openApp(
        androidPackageName: appId
    );
  } else {
    launch(storeUrl);
  }
} else if (Platform.isIOS) {
  if (await canLaunch(appId)) {
    launch(appId);
  } else {
    launch(storeUrl);
  }
}
Gayathri-GA commented 2 years ago

The support is now available in external_app_launcher: ^3.0.0