2016-08-30 56 views
0

我正試圖讓Visual Studio Cordova項目的應用程序速率插件工作,我無法看到它工作(對於Android設備)。Cordova(Android)。 AppRate插件只是簡單地調出空白屏幕

我基本上有一個按鈕,當點擊時調用我的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); 
    } 
} 
+0

console中的任何異常?白色的空白屏幕通常意味着你有錯誤 –

回答

0

是有可能發生由於以下原因: -

1)你是不是讓應用程序URL

2)你沒有給正確的應用程序URL(包名稱或應用程序ID)

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

解決方案

  • 首先要確保您的應用已Play商店或iTune的
  • 將正確的應用程序ID和程序包名稱config.xml中提到
  • 確保應用程序基本URL是正確的。