nativescript-local-notifications
nativescript-local-notifications copied to clipboard
iPad specific error when scheduling local notification
I was testing nativescript-local-notifications on an iPad Air with iOS 9.0.2 and I received an Error: setObjectForKey: object cannot be null javascript error when I tried to call the LocalNotifications.schedule function in my application. When I investigated further, it was throwing an error in local-notifications.js specifically around the interval parameter, saying that it can't be null. Once I added the interval parameter back in it worked.
In the README, it states that every schedule parameter is optional, but the error highlighted the interval option and the app would crash whenever it wasn't set. I ran my application on an android phone, android tablet, and an iPhone and each one of them ran with no issues when I didn't have interval set.
Hi, I'm guessing it has to do with the old iOS version running on your iPad. Can you confirm the iPhone is running iOS 10 or higher? That's hitting different code.
If you want to point out flaws on specific lines in the sourcecode then please do, by linking to the relevant lines. And if you want to try to fix it, you can edit the relevant file in node_modules/nativecsript-local-notifications.
The iPhone is running iOS 11, so you're right I think it has to do with the deprecated version of iOS. Thanks for the help
I'll take a look at the source code as well to see if I can be of any help!