How can I open a specific URL of the PlayStore/AppStore with flutter on Android and IOS, depending on which smartphone it is executed? I mean I want to open the application and not a browser or something like this.
In this thread I found some native way for android but how can I do this with flutter?
final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object
try {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
} catch (android.content.ActivityNotFoundException anfe) {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName)));
}
If there is currently no way to do this, it would be a nice feature to implement for the plugin url_launcher.