Crash APP iOS
See original GitHub issueIntro
Hello, when compile and call method this.appRate.promptForRating(true); the app doesn't work, crash and close.My ionic info
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-plugin-proxy : 1.5.8
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.9
Cordova Platforms : ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
Node : v10.2.1
npm : 6.1.0
OS : macOS High Sierra
Xcode : Xcode 9.4 Build version 9F1027a
Misc:
backend : legacy
How to fill preferences
this.appRate.preferences.displayAppName = 'Example';
this.appRate.preferences.usesUntilPrompt = 5;
this.appRate.preferences.promptAgainForEachNewVersion = false;
this.appRate.preferences.storeAppURL = {
ios: '*********', // I remove this for no show my app id in this post
android: 'market://details?id=*****' // I remove this for no show my app id in this post
};
this.appRate.preferences.customLocale = {
title : "Example",
message : "msg",
cancelButtonLabel : "cancel",
laterButtonLabel : "no",
rateButtonLabel : "rate"
}
// then in another function call
this.appRate.promptForRating(true);
Error in Xcode console
2018-06-15 14:02:22.026900-0300 APP[642:205905] -[NSNull length]: unrecognized selector sent to instance 0x1b76f0878 2018-06-15 14:02:22.034700-0300 APP[642:205905] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[NSNull length]: unrecognized selector sent to instance 0x1b76f0878’ *** First throw call stack: (0x18537ad8c 0x1845345ec 0x185388098 0x1853805c8 0x18526641c 0x18f1b99ac 0x18f1b98b0 0x18f1b97e8 0x100349ca4 0x10034aa90 0x100376a44 0x100376338 0x10036c598 0x1003793fc 0x10036c3f8 0x185dc60ec 0x185323404 0x185322c2c 0x18532079c 0x185240da8 0x187225020 0x18f25d758 0x1001a852c 0x184cd1fc0) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:11
Top GitHub Comments
I’ve been using this plugin for a while and got stuck on this. Looks like the plugin now requires you to supply a noButtonLabel and yesButtonLabel in your customLocale.
The Locales.getLocale() method used in showDialog (AppRate.js) does not check and provide default values for these. With your example above, when simpleMode === false, it calls;
navigator.notification.confirm(localeObj.appRatePromptMessage, promptForAppRatingWindowButtonClickHandler, localeObj.appRatePromptTitle, [localeObj.noButtonLabel, localeObj.yesButtonLabel]);
Which evaluates to;
navigator.notification.confirm('Msg', Func, 'Example', [undefined,undefined]);
// Note undefinedThe navigator.notification.confirm is actually what crashes the app as the button labels are undefined when passed back to native code.
For me at least, ensuring I’ve provided all of the custom locale properties (and specifically the no and yes button labels) has solved this;
@DualH Sorry, issue is fixed. Just do not laugh at me, the issue was that i was using:
ios: '<app_id>'
instead of:ios: 'app_id'
. Android the same, without “<>” must be.