Uncaught TypeError: Cannot read property 'done' of undefined
See original GitHub issueI’m using the plugin on Android and iOs, first i, use the plugin the simpliest way, like this inside a deviceready event :
AppRate.preferences.storeAppURL = {
ios: 'MYAPPNUMBER',
android: 'market://details?id=com.app'
};
AppRate.promptForRating(false);
it works fine but when i’m trying tu put custom messages, i’m getting this error in console :
AppRate.js:98 Uncaught TypeError: Cannot read property 'done' of undefined
at showDialog (AppRate.js:98)
at Function.AppRate.promptForRating (AppRate.js:203)
at Channel.<anonymous> (app.js:136)
at Channel.fire (cordova.js:822)
at cordova.js:231
this is my final code :
var msg = 'lorem ipsum ....';
AppRate.preferences = {
openStoreInApp: false,
displayAppName: '',
usesUntilPrompt: 3,
promptAgainForEachNewVersion: false,
storeAppURL: {
ios: 'MYAPPNUMBER',
android: 'market://details?id=com.my.app'
},
customLocale: {
title: 'Vous aimez l\'application ?',
message: msg,
cancelButtonLabel: "Non merci",
laterButtonLabel: "Plus tard",
rateButtonLabel: "Oui, je donne mon avis"
}
};
AppRate.promptForRating(false);
it works fine when i use promptFotRating without false…
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >Uncaught TypeError: Cannot read property of undefined In
JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible with the type expected by that operator or...
Read more >jquery Cannot read property 'done' of undefined - avoid this
You could just return a deferred, that way the done() callback won't generate errors, and you can choose to resolve it or not...
Read more >Uncaught TypeError : Cannot read properties of undefined
Looking for ways to handle Uncaught TypeError: Cannot read property of undefined in JavaScript? This guide will help you to catch errors.
Read more >Resolving the JavaScript Promise Error "TypeError: Cannot ...
TypeError - Cannot read property 'then' of undefined is thrown when the caller is expecting a Promise to be returned and instead receives ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah same issue with 1.3.0
@wroquet, I managed to make it work. You must define the callbacks, other wise you will get that error. I have defined them as empty functions and everything is now working as expected. But this is not clear at all at the README. Here is my code in coffeescript:
Cleaning the cache and opening the app twice will ask for the user review.