katzer / cordova-plugin-local-notifications

Cordova Local-Notification Plugin
Apache License 2.0
2.56k stars 1.75k forks source link

Sometime all scheduled notifications are triggered together on IOS 10 #1293

Closed abidvf closed 7 years ago

abidvf commented 7 years ago

WARNING: If you ignore this template, we'll ignore your issue.

Provide a general summary of the issue.

## Your Environment

## Expected Behavior All the scheduled notifications should be triggered at their scheduled time.

Tell us what should happen I am scheduling 5 notifications on daily basis at a different time to trigger. For example: reminderArray.push({ id: 7, text: "Its Maghrib Time", at: new Date(date+" "+timings["Maghrib"]).getTime(), icon: 'file://img/logo.png', sound: settings[7] ? 'res://platform_default' : (isAndroid ? 'file://audio/azan.wav' : 'file://audio/azan.aac'), every: "day" }); All these 5 notifications should be trigered at their respective times and they are triggering as well.

Tell us what happens instead Sometimes all these notifications are triggered all together at the same time which should not happen in this case.

Steps to Reproduce

Reproduce this issue; include code to reproduce, if relevant

  1. Pushing all notifications to an array as: reminderArray.push({ id: 7, text: "Its Maghrib Time", at: new Date(date+" "+timings["Maghrib"]).getTime(), icon: 'file://img/logo.png', sound: settings[7] ? 'res://platform_default' : (isAndroid ? 'file://audio/azan.wav' : 'file://audio/azan.aac'), every: "day" });

  2. Then scheduling all the notifications by calling as: $cordovaLocalNotification.schedule(reminderArray).then(function (result) { console.log(reminderArray); console.log("Reminders initialized!!"); });

Any solution in this regard will highly be appreciated.

Cheers

rwillett commented 7 years ago

As has been pointed out many times, do not use at: and every: in IOS 10. It no longer works as Apple has changed the underlying notifications code. Blame Apple. The new version when @katzer releases it, will probably not have this option in.

Also change the ``at:``` field to be something simpler so you have some idea what is happening. We have no idea what it is as we have no idea what timings is.

abidvf commented 7 years ago

@rwillett so what should be used for IOS 10 in place of at and every as we need to trigger these notifications on daily basis at a specific time?

rwillett commented 7 years ago

Write the code yourself. Thats what we do. Apple has changed the framework so nothing can be done.

grishchaudhary commented 7 years ago

I also facing the same issue, my scenario is when i set the local notification in specific date and time but i am getting every day but i only need it should be fired at specific date not repeatedly could you please look into it.

rwillett commented 7 years ago

@grishchaudhary

As already said, it can't be done. This is due to Apple. Also if you are writing code that needs to be fired at a specific data then simply set the dates up. This is simple coding.

abidvf commented 7 years ago

@rwillett When it is expected the updated version of the plugin @katzer will release?

rwillett commented 7 years ago

There isn't one AFAIK.

grishchaudhary commented 7 years ago

cordova.plugins.notification.local.schedule({id:1,title:"Hello",text:"Have Fun!" ,at:tommrow,every:"day"}) in this method when i remove the every properties it does not fire in ios whats wrong with my code please look into it.Thank you!

rwillett commented 7 years ago

@grishchaudhary

You are hijacking somebody else's issue. You have just jumped in, raise a new issue with the proper template. You need to read the docs as your code is wrong anyway, even if you do remove the every: method. I am not going to debug your code for you.

Secondly I am not the author, I am helping out.