“评价这个应用程序”谷歌播放商店链接在离子应用程序

"Rate this app" google play store link in Ionic app

本文关键字:应用程序 链接 谷歌 评价 播放      更新时间:2023-09-26

我想为我的Ionic应用程序添加"评分我们"google play store链接。我尝试如下

window.open('market://details?id=com.app.id', '_system');
<a href="market://details?id=com.app.id" target="_system">Rate us</a>

两者都对我不起作用。上面的代码有什么问题?有什么办法吗?

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

cordova plugin add org.apache.cordova.inappbrowser

然后使用以下代码

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

为什么不使用此插件: 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();

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

安装:科尔多瓦插件添加 https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin.git--变量URL_SCHEME=离子卡普

您可以将其重定向到市场,如上图所示。