Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
salem0426 opened this issue Jul 31, 2019 · 0 comments
Open

Comments

@salem0426
Copy link

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

  • Plugin version: 0.9.0-beta.3
  • Platform: iOS
  • OS version: 12.3.1
  • Device manufacturer / model: iPhone
  • Cordova version (cordova -v): iOS 4.5.5
  • Cordova platform version (cordova platform ls): iOS 4.5.5
  • Plugin config Cordova
  • Ionic Version (if using Ionic) N/A

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant