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

4

8

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?

Greedy answered 9/8, 2017 at 9:58 Comment(0)
G
11

I 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

Greedy answered 24/8, 2017 at 13:3 Comment(0)
K
3

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')
Kristeenkristel answered 23/1, 2021 at 20:0 Comment(0)
V
2

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);
     }
}
Virtuoso answered 24/1, 2020 at 12:9 Comment(0)
H
2

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.

Haim answered 15/9, 2020 at 15:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.