3

我想为我的应用添加“评价我们”google play store链接。Ionic我尝试如下

window.open('market://details?id=com.app.id', '_system');

<a href="market://details?id=com.app.id" target="_system">Rate us</a>

两者都不适合我。上面的代码有什么问题?有什么办法吗?

4

3 回答 3

6

我找到了答案,我们需要安装 InAppBrowser插件

cordova plugin add org.apache.cordova.inappbrowser

然后使用下面的代码

window.open('market://details?id=com.app.id', '_system');
于 2014-12-06T16:24:15.937 回答
4

为什么不使用这个插件:https ://github.com/pushandplay/cordova-plugin-apprate

我像这样成功地使用它:

        AppRate.preferences.useLanguage = cfg.useLanguage;
        AppRate.preferences.storeAppURL.ios = cfg.appStoreAppURL.ios;
        AppRate.preferences.storeAppURL.android = cfg.appStoreAppURL.android;
        AppRate.preferences.customLocale = cfg.customLocale;
        AppRate.preferences.displayAppName = cfg.displayAppName;
        AppRate.preferences.usesUntilPrompt = cfg.usesUntilPrompt;
        AppRate.preferences.promptAgainForEachNewVersion = false;
        AppRate.promptForRating();
于 2014-12-04T15:57:42.047 回答
0

这可以通过自定义网址实现!见这里: http: //mcgivery.com/using-custom-url-schemes-ionic-framework-app/

安装:cordova 插件添加https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin.git --variable URL_SCHEME=ionicapp

您可以将其重定向到市场,如上面的链接所示。

于 2015-01-14T06:27:25.450 回答