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

时间:2016-08-30 00:17:39

标签: javascript android cordova rate

我正在尝试使用适用于Visual Studio Cordova项目的app rate插件,但我看不到它的工作原理(适用于Android设备)。

我基本上有一个按钮,当点击时调用我的javascript文件中的一个名为RateTheApp的方法。

我的代码如下。我基本上复制/使用了以下代码:https://github.com/pushandplay/cordova-plugin-apprate

当我调用我的RateTheApp例程时,设备上的屏幕变为空白,没有任何反应。

非常感谢任何帮助。

谢谢!

泰德

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

1 个答案:

答案 0 :(得分:0)

是的,可能由于以下原因而发生: -

1)您没有提供申请网址

2)您没有提供正确的应用程序网址(包名称或应用程序ID)

3)应用程序在Play商店或iTune上不可用

解决方案

  • 首先确保应用程序在Play商店或iTune
  • 上可用
  • 在config.xml
  • 中提供正确的应用ID和包名称
  • 确保应用基本网址正确无误。