question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intro

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:open
  • Created 5 years ago
  • Reactions:2
  • Comments:11

github_iconTop GitHub Comments

10reactions
ralphcodecommented, Jul 21, 2018

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 undefined

The 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;

AppRate.preferences.customLocale = {
  title: "Would you mind rating %@?",
  message: "It won’t take more than a minute and helps to promote our app. Thanks for your support!",
  cancelButtonLabel: "No, Thanks",
  laterButtonLabel: "Remind Me Later",
  rateButtonLabel: "Rate It Now",
  yesButtonLabel: "Yes!",
  noButtonLabel: "Not really",
  appRatePromptTitle: 'Do you like using %@',
  feedbackPromptTitle: 'Mind giving us some feedback?',
};
1reaction
kurtievcommented, Jun 29, 2018

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

If an app on your iPhone or iPad stops responding, closes ...
If an app on your iPhone or iPad stops responding, closes unexpectedly, or won't open · Close and reopen the app. Force the...
Read more >
9 Fixes for When Your iPhone Apps Keep Crashing
9 Fixes for When Your iPhone Apps Keep Crashing · 1. Check Your Internet Connection · 2. Close and Relaunch the App ·...
Read more >
Reasons why iPhone Apps Are Crashing And How To Fix Them
If your iPhone software is outdated, it can trigger app crashes on your iPhone. Therefore, the best remedy is to update your iPhone...
Read more >
Fix Apple iPhone with apps that keep crashing after iOS 13
Troubleshooting Apple iPhone with apps that keep crashing after iOS 13 · First solution: Clear all background apps. · Second solution: Restart ...
Read more >
[Top 7 Ways] Fix iPhone Apps Keep Crashing on iOS 16
Part 2: 6 Common Ways to Fix iPhone Apps Crashing after iOS 16 Update · Way 1: Force Quit the Crashed App and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found