IONIC - How to open Application's feedback page in Play Store from Application using JavaScript

Viewed 7422

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?

4 Answers

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);
     }
}

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')

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.

Related