简体   繁体   English

科尔多瓦(Android)。 AppRate插件只会弹出空白屏幕

[英]Cordova (Android). AppRate plugin simply brings up blank screen

I am trying to get the app rate plugin working for Visual Studio Cordova project and I can not see to get it working (for Android device). 我正在尝试使适用于Visual Studio Cordova项目的应用程序费率插件正常运行,但看不到使它适用(适用于Android设备)。

I basically have a button that when clicked calls a method in my javascript file called RateTheApp. 我基本上有一个按钮,当单击该按钮时会在我的javascript文件中调用名为RateTheApp的方法。

My code is below. 我的代码如下。 I basically copied/used the code from: https://github.com/pushandplay/cordova-plugin-apprate 我基本上从以下地方复制/使用了代码: https//github.com/pushandplay/cordova-plugin-apprate

When the I call my RateTheApp routine the screen on the device goes blank and nothing happens. 当我调用RateTheApp例程时,设备上的屏幕变为空白,什么也没有发生。

Any help would be greatly appreciated. 任何帮助将不胜感激。

Thank you! 谢谢!

Ted 特德

AppRate.preferences = {
   useLanguage: 'en',
   openStoreInApp: true,
   displayAppName: 'Here I Am',
   usesUntilPrompt: 5,
   promptAgainForEachNewVersion: false,
   storeAppURL: {
       ios: '<my_app_id>',
       android: 'market://details?id=com.tedjyoung.hereiam',
       windows: 'ms-windows-store://pdp/?ProductId=<the apps Store ID>',
       blackberry: 'appworld://content/[App Id]/',
       windows8: 'ms-windows-store:Review?name=<the Package Family Name of the application>'
   },
   customLocale: {
       title: "Rate 'Here I Am'",
       message: "If you enjoy using 'Here I Am', would you mind taking a moment to rate it? It won’t take more than a minute. Thanks for your support!",
       cancelButtonLabel: "No, Thanks",
       laterButtonLabel: "Remind Me Later",
       rateButtonLabel: "Rate It Now"
   }
};

AppRate.preferences = {
   useCustomRateDialog: true,
   callbacks: {
       onRateDialogShow: function (callback) {
           callback(1) // cause immediate click on 'Rate Now' button 
       },
       onButtonClicked: function (buttonIndex) {
           console.log("onButtonClicked -> " + buttonIndex);
       }
   }
};

function RateTheApp() {
   try {
       AppRate.promptForRating(false);
   } catch (e) {
       alert("Error rating app.  Error = " + e.message);
   }
}

Yes it may happen due to following reasons:- 是的,可能由于以下原因而发生:

1) You are not giving application url 1)您没有提供应用程序网址

2) you are not giving correct app url (package name or App id) 2)您没有提供正确的应用程序网址(程序包名称或应用程序ID)

3) App is not available on play store or iTune 3)应用程式无法在Play商店或iTune上使用

Solution

  • first make sure that app is available on play store or iTune 首先请确保该应用在Play商店或iTune上可用
  • Place correct app Id and package name as mention in config.xml 按照config.xml中的说明放置正确的应用程序ID和程序包名称
  • make sure that app base url is correct. 确保应用基本网址正确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM