-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Notifications not fired at the right time. #1190
Comments
Please use the template in #1188 with more information and update your question. Rob |
@rwillett done. |
It looks pretty much the same as ours and ours works on Android 6.0. Our differences:
to create four reminders that are scheduled in 60 secs and at 19:30, 20:30 and 21:00 for today. and we create the array using
We add the icon separately to the above for a reason that now escapes me.
Our icon is a slightly different URL. My feeling is that you are doing something wrong with the at: value but I can't see what. Post your code to create the at: value and see what that does. Rob |
@rwillett thanks for your answer. For testing purposes I tried your example and I still have the same issue. The first reminder was pushed at the right time, the second and last reminders were pushed at 15:26. See below:
|
At what time are you running the code? Are you putting the scheduled time far enough in the future from when you run? We are also running a later version of the plugin, however I don't think thats the issue as we had this working on Android 6.0 some versions ago. Getting two alerts at the same time sounds as if something is being overwritten. If this was C I'd start looking for a memory leak :) You have the code we use in production. I will check its still working on Android 6.0 later today or tomorrow but am busy at the moment. Can't think of anything else at this time. I'll check its working on our app again and come back. What other plugins are you running? Rob |
Specified code runs when the app goes to the background. For testing purposes I'm scheduling the notifications 5-10 min in the future. When I check the pending notifications, the "at" property specifies the right amount of seconds, so that's a bit strange. I'm running the following plugins:
I will try the same in a new blank Ionic App. |
I just isolated the problem into a blank Ionic app. I got the exact same problem. I also build the same app on my Samsung Galaxy S7 (Android 6.0.1) and it surprisingly works... So for now I think I will build my own timing functionality with $timeout. |
That's interesting and annoying. The $timeout won't work on IOS though in the background. Have you tried scheduling them one at a time. |
You could try the later version of the plugin as well. |
I'm using 0.8.4, that's the latest right? Scheduling one at a time results in the same behavior, scheduling one at a time in a forEach loop fires all push notifications at once at the last "at" time, despite the fact that the "at" date seems to be right. |
There is a 0.8.5 dev branch.
sounds really odd to me. That sounds like the However since it works on a Samsung Galaxy S7 (Android 6.0.1), it does seem to indicate that Samsung have changed something. I'll test it on an Android 6.0 Nexus |
We've just rebuilt a test version on Android 6.0.1, Nexus 5. We schedule four notifications and they all appeared. Here is the entire production function directly cut from the source, no changes have been made. The const
We've just simulated a trip into London's congestion zone and got the notifications appear on the notification shade |
Where can I find the 0.8.5 dev branch? |
Tested the 0.8.5 version. Same results. Working as it should be on my Samsung Galaxy S7, but not on the Samsung Galaxy Tab A.
|
This is a Samsung issue then. Also we used to put stuff in $timeout functions. We found that it wasn't needed AND it caused race conditions when rescheduling and reworking the local notifications. Rob |
Ok, I will use my own timing functionality then. Thanks anyway! :) |
Ionic Local Notification does not trigger sometimes or does not trigger other times. Sometimes it triggers before time set time. I am facing a different scenario
below is my code
|
My Enviroment
Ionic
Plugin version: de.appplant.cordova.plugin.local-notification 0.8.4
Platform: Android
OS: macOS Sierra
Device manufacturer / model: Samsung Galaxy Tab A
Cordova version (cordova -v): 6.4.0
Cordova platform version (cordova platform ls): Installed platforms: android 6.0.1
Expected Behavior
I have scheduled 3 notifications: 09:10, 09:15, 09:20, they should fire at te right time.
Actual Behavior
They are not fired at the right time, sometimes the first one is fired, the second one isn't and at the last scheduled time it fires two times. It's completely random.
Steps to Reproduce
Scheduling code:
When I check the pending notifications with:
The 'at' property is correctly set, in my example 1484640600, 1484640900, 1484641200.
The text was updated successfully, but these errors were encountered: