cordova-plugin-local-notifications icon indicating copy to clipboard operation
cordova-plugin-local-notifications copied to clipboard

Notifications not firing in iOS 14

Open mikenowakme opened this issue 4 years ago • 8 comments

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

Provide a general summary of the issue.

Your Environment

  • Plugin version: 0.9.0-beta.2
  • Platform: iOS
  • OS version: 14.0.1
  • Device manufacturer / model: Apple
  • Cordova version (cordova -v): 9.0.0
  • Cordova platform version (cordova platform ls): android 8.1.0 browser 6.0.0 ios 5.1.1
  • Plugin config
  • Ionic Version (if using Ionic)

Expected Behavior

Permission dialog appears on first schedule of a notification and the app shows up in the list of apps receiving notifications under Settings > Notifications

Actual Behavior

Dialog does not appear and the app doesn't show up in the list of apps receiving notification.

Steps to Reproduce

Try running under iOS 14.

Context

Here is the code I am using: export function scheduleNotification(notificationId, title, content, deliveryDateTime) { if (typeof cordova !== 'undefined' && cordova.plugins.notification != undefined) { let delivery = new Date(deliveryDateTime.ts) cordova.plugins.notification.local.hasPermission(function (granted) { if (granted) { cordova.plugins.notification.local.schedule({ id: notificationId, title: title, text: content, trigger: { at: delivery }, foreground: true });

    console.log("Schedule #" + notificationId + ": " + content + " at " + delivery);  
  }
});

} }

Debug logs

There are no crash logs -- just no notifications or permissions requests.

mikenowakme avatar Oct 16 '20 14:10 mikenowakme

anyone got input on this? @mikenowakme ?

UPDATE: the issue was not iOS version but rather not firing well when app in foreground on iOS. might be collision with phongap push plugin. investigating further

souly1 avatar Nov 12 '20 18:11 souly1

It worked better when I manually requested permission. I am not using phonegap should there be no conflict there.

mikenowakme avatar Nov 23 '20 20:11 mikenowakme

Hello, Still cannot get local notifications (pop up) when I send push notifications, on emulator neither iphone real, how can I find a solution? Thank you!

manel00 avatar Mar 10 '21 22:03 manel00

Hi all, perhaps you can try this fork, it is more recent and still maintained (to my knowledge): https://github.com/timkellypa/cordova-plugin-local-notifications

Hope it helps. Thanks.

rahmadid avatar Mar 11 '21 07:03 rahmadid

Hi all, perhaps you can try this fork, it is more recent and still maintained (to my knowledge): https://github.com/timkellypa/cordova-plugin-local-notifications

Hope it helps. Thanks.

Can you explain please how to install it and so on? thank you

manel00 avatar Mar 11 '21 09:03 manel00

Hello?

manel00 avatar Mar 15 '21 10:03 manel00

@manel00 cordova plugin add https://github.com/timkellypa/cordova-plugin-local-notifications.git should work for you

Maqsyo avatar Mar 25 '21 07:03 Maqsyo

In my case I realized I didn't call await LocalNotifications.requestPermissions() before trying to send the notification. Note that the latest version of the project is now at https://github.com/ionic-team/capacitor-plugins/

x-ji avatar Aug 26 '23 00:08 x-ji