In my Ionic Application, I need to open my other application link in Play store.
I have tried following so far :
window.open('market://details?id=com.myapp.something', '_self')
And
window.open('market://details?id=com.myapp.something', '_system', 'location=no');
Above links opens in InnAppBrowser, I need them to open in playstore itself.
Any suggestions?
In my Ionic Application, I need to open my other application link in Play store.
I have tried following so far :
window.open('market://details?id=com.myapp.something', '_self')
And
window.open('market://details?id=com.myapp.something', '_system', 'location=no');
Above links opens in InnAppBrowser, I need them to open in playstore itself.
Any suggestions?
Share Improve this question edited Sep 19, 2020 at 8:51 Sangwin Gawande asked Aug 9, 2017 at 9:58 Sangwin GawandeSangwin Gawande 8,1668 gold badges52 silver badges67 bronze badges4 Answers
Reset to default 11I found that you can open it in your system Browser with Package ID and it will automatically redirect you to respective application store.
$window.open("https://play.google.com/store/apps/details?id=your-app-package-name&hl=en","_system");
This worked for me the best.
EDIT :
There is a plugin available which might help : Launch Review
Redirect IONIC application to play store
window.open("https://play.google.com/store/apps/details?id=com.carClient.bookMyDreamCar","_system");
open playstore in your application
window.location.assign('https://play.google.com/store/apps/details?id=com.carClient.bookMyDreamCar')
If you want to open market apps for rating reviews then will be better to use this plugin instead
Ionic V3: https://ionicframework.com/docs/v3/native/launch-review/
Ionic >= V4: https://ionicframework.com/docs/native/launch-review
It has in app review for ios >10.3 (higher changes to get a review) and simply opens google play market for android.
Dependency injection:
import { LaunchReview } from '@ionic-native/launch-review';
constructor(
private _platform: Platform,
private _launchReview: LaunchReview
) { }
Implementation:
appId = null;
if (this._platform.is('android')) {
appID = '_COM.ANDROID.PACKAGE.NAME_';
} else if (this._platform.is('ios')) {
appID = '_APPLEID_';
}
if (appID) {
if (this._launchReview.isRatingSupported()) {
// For iOS > 10.3
this._launchReview.rating().then((result) => {
alert(result);
});
} else {
this._launchReview.launch(appID);
}
}
2020 Answer. Ionic 4.
Only window.location.assign
helped for me. Working both iOS and Android. iOS URL should be itms-apps://itunes.apple.com/app/${iosITunesAppId}
, Android one https://play.google.com/store/apps/details?id=${packageName}
. packageName
can be obtained using cordova-plugin-app-version
plugin.
UPD: looks as I found why methods like window.open('market://details?id=com.myapp.something', '_system');
didn't work for me. Looks as they require cordova-plugin-inappbrowser
plugin to be installed. I haven't that plugin installed in my app so that method didn't work.