Steffaan / cordova-plugin-local-notifications

Cordova Local Notifications Plugin
Apache License 2.0
31 stars 38 forks source link

iOS plugin works first time in foreground, crashes every other time #24

Open salem0426 opened 5 years ago

salem0426 commented 5 years ago

WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!

cordova-plugin-local-notifications on iOS works great with initial test of having the app in background. But when I attempted to change the behavior to have it work in the foreground, it only works the first time.

Your Environment

Expected Behavior

Every time my app calls this function, I would like a notification to appear.

Actual Behavior

Only works the first time and crashes every other time.

Steps to Reproduce

I have a function call that passes as an argument the text string that needs to be displayed. To keep the test simple, I’m disabling the text string passing and using a hard coded text string.

Context

ntfObj = { actions: [ {id:'0', title: 'PEARL Alert', text: 'hardcoded text'} ], foreground: true};

First time, I successfully get the notification. cordova.plugins.notification.local.schedule(ntfObj);

When I call it a second time: cordova.plugins.notification.local.update('0');

The app crashes

I have also tried cordova.plugins.notification.local.on for the second call, same result.

Debug logs

Error message when the app crashes:

2019-07-31 06:07:46.247162-0400 PEARL[643:292777] -[NSTaggedPointerString objectForKey:]: unrecognized selector sent to instance 0xedf4d5aa222822f6 2019-07-31 06:07:46.251461-0400 PEARL[643:292777] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString objectForKey:]: unrecognized selector sent to instance 0xedf4d5aa222822f6' First throw call stack: (0x1c087127c 0x1bfa4b9f8 0x1c078dab8 0x1c0876ac4 0x1c087875c 0x100da14c0 0x101cff6f0 0x101d00c74 0x101d03ad4 0x101d11dc8 0x101d127ac 0x1c04911b4 0x1c0493cd4) libc++abi.dylib: terminating with uncaught exception of type NSException