0

So I got the plugin installed OK according to the log files. But for some reason, I just cannot get it to work. And ideas?

<script type="text/javascript" charset="utf-8"> 
function onLoad() {
        document.addEventListener("deviceready", onDeviceReady, false);
    }

function onLoad() {
    var AppRate;
    AppRate.preferences.storeAppURL = {
    ios: '123456789'
    };

    AppRate.promptForRating();
    }
</script>   

1 Answers1

0

You have onLoad() function twice and you do not call it. It should be:

$(function () {
    document.addEventListener("deviceready", onLoad, false);
});

function onLoad() {
    var AppRate;
    AppRate.preferences.storeAppURL = {
        ios: '123456789'
    };

    AppRate.promptForRating();
}
Hristo Eftimov
  • 13,845
  • 13
  • 50
  • 77
  • Should it not rather be: function onLoad() { document.addEventListener("deviceready", onDeviceReady, false); } function onDeviceReady() { var AppRate; AppRate.preferences.storeAppURL = { onLoad is to quick as the device is not ready. It should only run onDeviceReady I think? –  Dec 14 '16 at 08:10
  • it is ok, but when you will run onLoad() function? – Hristo Eftimov Dec 14 '16 at 08:14
  • Or it could be that there is a bug in the plugin? –  Dec 14 '16 at 08:17
  • 1
    include an alert('test'); into onDeviceReady() function before var AppRate; if it appear that means the plugin is not working. If you don't see the alert message that means you don't call the function ;) – Hristo Eftimov Dec 14 '16 at 08:19
  • Seems like it might be the plugin. The alert works fine. –  Dec 14 '16 at 21:32