-
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
Just Fires Once #1192
Comments
Try it with id as a string, not a number. id: “991"
… On Jan 17, 2017, at 3:21 PM, Michael Amaral ***@***.***> wrote:
Your Environment
Plugin version: de.appplant.cordova.plugin.local-notification 0.8.5-dev
Platform: iOS
OS version: 10.2 (14C92)
Device manufacturer / model: iPhone 6 - MG3H2BR/A
Cordova version (cordova -v): 6.3.1
Cordova platform version (cordova platform ls): ios 4.2.1
Expected Behavior
Notifications should be triggered at the time
Actual Behavior
I build and install the app in my device, and when I open for the first time and schedule the notifications, them works fine.
But them just works once. Reinstalling the app have the same effect; works the first time.
Steps to Reproduce
Scheduling code:
var testNotification = function(){
var notif = [
{
title: "One",
text: "Text",
at: new Date(new Date().getTime() + (10 * 1000)),
id: 991
},
{
title: "Two",
text: "Text",
at: new Date(new Date().getTime() + (30 * 1000)),
id: 992
},
{
title: "Three",
text: "Text",
at: new Date(new Date().getTime() + (50 * 1000)),
id: 993
},
]
$cordovaLocalNotification.schedule(notif);
}
When I try to log:
$cordovaLocalNotification.getAll()
It shows fine at the first time (which is triggered), but the array show empty then.
Context
Actually I have to schedule repeated notifications, but it's not working, so I'm trying to debug my way out of it.
I'm having issues with this for months
|
Just tried it out. Works exactly the same |
This works on 10.0. I don't have a phone with 10.2 on it to test this against. Also what does works just once mean. It only fires the first schedule and not the rest? Or it fires them all but won't repeat if you execute it twice? The code #1190 works for us, but its very similar to your code. Does the fact you're calling Rob |
Means that only the first schedule works; if I schedule just one notification, just this one will works. If I scheduled an array of 3 notifications at once, all the 3 will fire, but if I schedule them again by reopening the app (running the trigger in platform ready), nothing happens. Also, it doesn't work with "every" attribute. I've checked the #1190 before opening this issue; they are very similar, but not exactly the same. I'm calling |
We are doing the same thing and ours works. Are you definitely incrementing the id to a unique ID and not reusing? Are you checking and cancelling or checking and NOT cancelling or just cancelling? We cancel everything before we reschedule or add new schedules in using
Rob |
@rwillett It's working with iOS 10.2? It works if you use it with 'every' attribute? (If you tried so). I'm not cancelling, nor clearing anything. I actually do that normally, but right now I'm trying to get it working the simplest possible way, so I just schedule using the code I've posted here, and that is it. I can try clear and cancel everything, but that seems weird to me. |
We don't have a 10.2 phone, we have 10.1.1 (14B150). To summarise, it works on your IOS 10.2 phone the first time, i.e. all three notifications are called but you can't call it twice and get it working the second call? This should work in the Xcode simulator though, its only push notifications that don't work. have you tried it there? Rob |
I've tried the simulator too, and I've got the same behavior. |
In 10.1 and 10.2? |
@rwillett Do you schedule them all at once? In an array? What about setting repeating notifications with every attribute? |
Every time we set notifications we set them at once in an array. We work with four or so at a time, though we sometimes send up to 12 or 13 in one of our test cases. We never use repeating notifications using the #1190 contains the actual code we use in our production app. Its not very difficult and as can be seen from the screen shot above it works. We get four local notifications coming through at the right time on IOS 10.2. |
@rwillett Got it. Since your code is working, can you at least try setting one test notification to every minute? Just to see what happens? They should work |
On IOS 10, (at: OR firstAt:) AND every: do not work together on IOS 10 and it is unlikely they ever will as Apple appears to have changed their underlying framework. This could well be the problem. Also the current IOS 10 is buggy. Rob |
How would you make a use of every: without the at:? Basically, you can't use 'every' anymore. So I thing it should be removed from the official docs and the plugin itself, no? Anyway, for it still just works only the first time I schedule. I need to reinstall the app, so it works again.. once |
The plugin is being rewritten to handle IOS 10. As I understand it, Apple (not @katzer) has changed the way notifications work, the underlying framework has changed and as a result of this, the way notifications will work in the future will be without the combination of @katzer is busy updating the plugin to properly work with IOS 10. I suspect that the documentation is low down on his to-do list. It may be removed from the local notification plugin when it is released. Since I don't use Rob |
That is really nice to know; that @katzer is updating it. Anyway, despite the every attribute, returning to this issue, I'm not using every, and still is not working. |
I'm out of ideas now. |
Just to report it here: I created a new Ionic Project from scratch, installed the ios10 branch and it worked fine. Of course it didn't work with |
If it works in a simple app then its your code or some sort of plugin conflict. We have no idea what plugins you are using or the rest of your code, so there may be something in there. Start simply and work up adding functionality in. It does work (sans |
The thing is.. this is very strange; the code WAS working. The version in App Store works fine for most, but some now and then I receive email from users saying that is not receiving the notifications. Now I'm trying to isolate plugins and checking any kind of incompatibility between them. |
Plugins versions? |
My plugins:
iOS Version: 10.2.1 (14D27) No code changes that justify the issue of firing just once |
As a starting point for your elimination quest, this is the plugin set we use—and it works. Note that I use my own fork of the local notification plugin which is based on one of the early fixes for iOS 10 so it’s not exactly the same as what you’re using.
(!562)-> cordova plugins ls
cordova-custom-config 3.1.2 "cordova-custom-config"
cordova-plugin-app-event 1.2.0 "Application Events"
cordova-plugin-background-task 0.2.0 "Background Task"
cordova-plugin-camera 2.3.2-dev "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-dialogs 1.2.1 "Notification"
cordova-plugin-email-composer 0.8.3 "EmailComposer"
cordova-plugin-file 4.2.0 "File"
cordova-plugin-fullscreen 1.1.0 "cordova-plugin-fullscreen"
cordova-plugin-globalization 1.0.5 "Globalization"
cordova-plugin-inappbrowser 1.4.0 "InAppBrowser"
cordova-plugin-insomnia 4.2.0 "Insomnia (prevent screen sleep)"
cordova-plugin-media 1.0.1 "Media"
cordova-plugin-navigationbar 1.0.31 "Cordova NavigationBar plugin"
cordova-plugin-network-information 1.2.1 "Network Information"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-whitelist 1.3.2-dev "Whitelist"
de.appplant.cordova.plugin.local-notification 0.8.4+ledControl+spk0611iOS10Changes "LocalNotification"
phonegap-plugin-mobile-accessibility 1.0.5-dev "Mobile Accessibility"
phonegap-plugin-push 1.8.4 "PushPlugin"
… On Jan 30, 2017, at 1:47 AM, Michael Amaral ***@***.***> wrote:
My plugins:
cc.fovea.cordova.purchase 6.0.0 "Purchase"
cordova-plugin-3dtouch 1.3.5 "3D Touch"
cordova-plugin-app-event 1.2.0 "Application Events"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-badge 0.7.4 "Badges"
cordova-plugin-console 1.0.4 "Console"
cordova-plugin-datepicker 0.9.2 "DatePicker"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-device-motion 1.2.2 "Device Motion"
cordova-plugin-dialogs 1.3.0 "Notification"
cordova-plugin-email-composer 0.8.3 "EmailComposer"
cordova-plugin-globalization 1.0.4 "Globalization"
cordova-plugin-inappbrowser 1.5.0 "InAppBrowser"
cordova-plugin-listpicker 2.2.2 "ListPicker"
cordova-plugin-registerusernotificationsettings 1.0.2 "RegisterUserNotificationSettings"
cordova-plugin-shake 0.5.4 "Shake Gesture Detection"
cordova-plugin-splashscreen 4.0.0 "Splashscreen"
cordova-plugin-statusbar 2.2.0 "StatusBar"
cordova-plugin-vibration 2.1.2 "Vibration"
cordova-plugin-whitelist 1.3.0 "Whitelist"
cordova-plugin-wkwebview-engine 1.1.1-dev "Cordova WKWebView Engine"
cordova-plugin-x-socialsharing 5.1.3 "SocialSharing"
cordova-sqlite-storage 1.4.9 "Cordova sqlite storage plugin"
de.appplant.cordova.plugin.local-notification 0.8.5-dev "LocalNotification"
ionic-plugin-keyboard 2.2.1 "Keyboard"
iOS Version: 10.2.1 (14D27)
No code changes that justify the issue of firing just once
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@Tawpie there are some differences between some plugins, but they shouldn't matter. Maybe, MAYBE, it could be related to the WKWebView. Gonna try removing it and see what happens. Also, I've tried to use this same branch in Android and it couldn't find the plugin. The console log just showed as undefined. |
We have similar plugins but not the same. We have never used the WKWebView plugin though.
|
Hey guys, I've created a new ionic project and migrated the code to the new one (weird since I've tried resetting platform settings, and didn't work). Now it's working fine as long as I don't use Is there a reason for the Thanks |
The reason is that every: is not supported on IOS 10 and will not be supported by Apple. |
Your Environment
Plugin version: de.appplant.cordova.plugin.local-notification 0.8.5-dev
Platform: iOS
OS version: 10.2 (14C92)
Device manufacturer / model: iPhone 6 - MG3H2BR/A
Cordova version (cordova -v): 6.3.1
Cordova platform version (cordova platform ls): ios 4.2.1
Expected Behavior
Notifications should be triggered at the time
Actual Behavior
I build and install the app in my device, and when I open for the first time and schedule the notifications, them works fine.
The first schedule works; if I schedule just one notification, this one will works. If I scheduled 3 at once, all the 3 will be fired, but if I schedule again, nothing happens
But them just works once. Reinstalling the app have the same effect; works the first time.
Steps to Reproduce
Scheduling code:
When I try to log:
$cordovaLocalNotification.getAll()
It shows fine at the first time (which is triggered), but the array show empty then.
Context
Actually I have to schedule repeated notifications, but it's not working, so I'm trying to debug my way out of it.
I'm having issues with this for months☹️
The text was updated successfully, but these errors were encountered: