Dear @katzer,
we are using your plugin in hybrid app for a very important costumer and we have a problem with notification in iOS 10 GM using version 0.8.4.
The issues is not display the notification in iPhone devices.
Waiting for your new release that patch this issue I modified then plugin, following the indication present in the issues #1034.
I've created a new fork here: https://github.com/acianti/cordova-plugin-local-notifications, please refer to this to find details of modification done.
Can you please implement as soon as possible the above fix in the new version of plugin. Can you also please inform about possible date in which new plugin would be avaible?
Many thanks in advance for your support!
Best regards,
Andrea
Even I am facing the same issue. I am using Ionic and notifications are not getting scheduled for iOS 10. Do i need to use the new fork temporarily https://github.com/acianti/cordova-plugin-local-notification.?
I too facing same issue, working on ionic App with local notification.
any workaround to use deprecated UILocation or update in the plugin itself?
@sumedh908 @gaurangpatel I have fixed the issue on iOS 10 and created the PR - #1093
Please have a look and let me know if that works.
Thanks @spk0611 ,
I changed the file APPLocalNotification.h and added framework 'UserNotifications', I am getting notification when exit from region but not at enter region.
Do I need to make any other changes besides these two?
May be issues is related to delay or execution time but not sure.
š +1
@katzer any chance to have a clean release for ios 10 ?
As a ionic user i'm really blocked outthere :(
Any updates on release on IOS 10?
I could find the fix in the ios branch and it seems to work well.
cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#ios10
@timelight does this work well on android as well?
Hi,
I've updating my plugin but it doesn't work. I do this :
$timeout(function(){
cordova.plugins.notification.local.schedule({
title: "New Message",
message: "Hi, are you ready? We are waiting."
});
alert('timeout');
},5000);
I send just one notification after 5s app started.
What's wrong ? I'm using #ios10 update.
Thx !!!
Sorry but it doesn't work for me. I don't know why.
Here, my plugins list :
com.unarin.cordova.beacon 3.4.0 "Proximity Beacon Plugin"
cordova-plugin-app-event 1.2.0 "Application Events"
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-device 1.1.3 "Device"
cordova-plugin-whitelist 1.3.0 "Whitelist"
de.appplant.cordova.plugin.local-notification 0.8.4.1 "LocalNotification" -> downloaded from https://github.com/Telerik-Verified-Plugins/LocalNotification.git
My app authorize Notification and I just send a test, there is nothing else.
Any idea ?
Thanks a lot .
@timelight it works for you ? do you have any example ? Thx.
Hi i tried the version reference above by EddyVerbruggen, which hasent been merged yet. It works in my ionic app.
@ddennis do you have a sample code ? I can find the solution, it works on iOS9 but not on iOS10. It's incredible !! Thx
@sKuD51 I removed the current version with:
cordova plugin rm add de.appplant.cordova.plugin.local-notification
And install the telerik version from github:
cordova plugin add https://github.com/Telerik-Verified-Plugins/LocalNotification
@ddennis that's I've did :-(
I'm using cordova 6.1.1, cordova ios 4.1.2 and xcode 8.0
@sKuD51 maybe the problem is in your client code
@ddennis Maybe, but I can understand why it works fine on iOS 9 and not on iOS10. I've the prompt windows and I click Allow, but that's all, I've no notification.
Thx.
@sKuD51: be sure to include a string id⦠id: āTestingā
or something similar as well as specify the you want the reminder to fire (the āat:ā option). Your code sample doesnāt reflect correct use of the API for the plugin. Hereās where you can find more information: https://github.com/katzer/cordova-plugin-local-notifications/wiki/04.-Scheduling https://github.com/katzer/cordova-plugin-local-notifications/wiki/04.-Scheduling
On Oct 3, 2016, at 8:36 AM, sKuD51 [email protected] wrote:
Hi,
I've updating my plugin but it doesn't work. I do this :
$timeout(function(){
cordova.plugins.notification.local.schedule({
title: "New Message",
message: "Hi, are you ready? We are waiting."
});
alert('timeout');
},5000);
I send just one notification after 5s app started.
What's wrong ? I'm using #ios10 update.
Thx !!!ā
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/katzer/cordova-plugin-local-notifications/issues/1096#issuecomment-251140055, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVytHsWvfvBr76fRmK8YT_F3FN47V67ks5qwSDlgaJpZM4J8ec0.
So,
I create a new simple project app : cordova create test2 com.test1.app test2 with cordova 6.1.1 and just add plugin : cordova plugin add https://github.com/acianti/cordova-plugin-local-notifications
Next, I add iOS platform : cordova platform add ios
Here are my logs :
`Adding ios project...
iOS project created with [email protected]
Installing "de.appplant.cordova.plugin.local-notification" for ios
Fetching plugin "cordova-plugin-device" via npm
Installing "cordova-plugin-device" for ios
Fetching plugin "cordova-plugin-app-event" via npm
Installing "cordova-plugin-app-event" for ios
Your support is needed. If you use the local-notification plugin please support us in order to ensure further development.
https://github.com/katzer/cordova-plugin-local-notifications#supporting
Thank you!
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for ios
Finally, I just add a simple notification in index.js in deviceready event :
onDeviceReady: function() {
alert('ready to go');
cordova.plugins.notification.local.schedule({
id: 1,
text: "Single Notification",
sound: isAndroid ? 'file://sound.mp3' : 'file://beep.caf'
});
app.receivedEvent('deviceready');
},`
And I run : cordova run ios
I see alert, prompt window, I allow notification, but there is no notification in list.
How can I do more simple like this ?
you still need to tell it when to fire the notification (the at: option)⦠like at: new Date(new Date().getTime() + 10000)
And the id: _MUST_ be a string, not an int.
On Oct 4, 2016, at 7:51 AM, sKuD51 [email protected] wrote:
So,
I create a new simple project app : cordova create test2 com.test1.app test2 with cordova 6.1.1 and just add plugin : cordova plugin add https://github.com/acianti/cordova-plugin-local-notifications https://github.com/acianti/cordova-plugin-local-notifications
Next, I add iOS platform : cordova platform add ios
Here are my logs :
`Adding ios project...
iOS project created with [email protected]
Installing "de.appplant.cordova.plugin.local-notification" for ios
Fetching plugin "cordova-plugin-device" via npm
Installing "cordova-plugin-device" for ios
Fetching plugin "cordova-plugin-app-event" via npm
Installing "cordova-plugin-app-event" for iosYour support is needed. If you use the local-notification plugin please support us in order to ensure further development. https://github.com/katzer/cordova-plugin-local-notifications#supporting Thank you!
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for ios
Finally, I just add a simple notification in index.js in deviceready event :
onDeviceReady: function() {
alert('ready to go');
cordova.plugins.notification.local.schedule({
id: 1,
text: "Single Notification",
sound: isAndroid ? 'file://sound.mp3' : 'file://beep.caf'
});
app.receivedEvent('deviceready');
},`
And I run : cordova run ios
I see alert, prompt window, I allow notification, but there is no notification in list.
How can I do more simple like this ?ā
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/katzer/cordova-plugin-local-notifications/issues/1096#issuecomment-251411506, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVytMGDOkEAt6wMQlYY2Sy09JRBMkAhks5qwmgNgaJpZM4J8ec0.
@Tawpie I never used "at option", because I send notification on click (for example). And I've tried with String id => nothing .
I'm going crazy !!!
@sKuD51 I think that youāll still need to specify at:
because if you donāt provide a fire date/time the phone does not know when to trigger the notification.
Be sure to set the fire date far enough in the future so that the fire date doesnāt happen before the software has a chance to complete the actual scheduling with the phoneās operating system. Notifications scheduled in the past wonāt fire. Scheduling a notification to fire a second or two into the future should be fairly immediate for the user.
Curious though, if youāre wanting to alert the user on-click, is it necessary to use the local notification mechanism?
On Oct 4, 2016, at 8:12 AM, sKuD51 [email protected] wrote:
@Tawpie https://github.com/Tawpie I never used "at option", because I send notification on click (for example). And I've tried with String id => nothing .
I'm going crazy !!!ā
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/katzer/cordova-plugin-local-notifications/issues/1096#issuecomment-251418076, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVytK856HNivcRdxWWRKjvys50hNv8Sks5qwmz6gaJpZM4J8ec0.
@Tawpie In my app, I'm using notification with ibeacon plugin. When app is in background mode and user enter in a ibeacon region, app send a notification with ibeacon's enter message. This method worked very fine in iOS 9, 8, 7 ... and I repeat, I never used 'at' option, because I send notification in 'live' .
So, I don't understand the problem.
I thank you for yours advices.
I understandāthatās an entirely different use case than what I use. But if you can stand a delay of a second or two, you could try setting an at:
time a couple seconds into the future.
Iām not sure of all the changes Apple made in iOS10, but something they did broke the way this plugin worked. Which tells me that in the OS something has changed, so what worked on iOS 7-9 may now be broken.
Good luck!
On Oct 4, 2016, at 8:46 AM, sKuD51 [email protected] wrote:
@Tawpie https://github.com/Tawpie In my app, I'm using notification with ibeacon plugin. When app is in background mode and user enter in a ibeacon region, app send a notification with ibeacon's enter message. This method worked very fine in iOS 9, 8, 7 ... and I repeat, I never used 'at' option, because I send notification in 'live' .
So, I don't understand the problem.
I thank you for yours advices.ā
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/katzer/cordova-plugin-local-notifications/issues/1096#issuecomment-251428146, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVytAJrOuILzAFI_wHuoUMZQStGHRoXks5qwnTxgaJpZM4J8ec0.
@Tawpie Thanks. iOS10 is really a p... of ch.. there are so many changes and some plugins doesn't work.
FYI, the notification is working on the ios simulator (only in background mode, so get back to device home) but not on a real device :(
It is driving me crazy !
cordova.plugins.notification.local.schedule({
id: 'ID-'+Date.now(),
at: new Date(new Date().getTime() + 10000),// now + 1s
title: 'TEST',
text: 'TEST content',
badge: 666
});
@lucbonnin I confirmed, notification is only displayed when app is in background, and I tested my app on real device, that's run.
And I confirm again, in my app, I use this plugin like this :
cordova.plugins.notification.local.schedule({
id : i,
title : "My title",
text : "My message",
badge : i
});
Where i is an integer that I increment if app displays more than one notification.
In other way, If found this example : https://swifting.io/blog/2016/08/22/23-notifications-in-ios-10/ but I don't know if we could adapt-it in this plugin. @katzer ?
can you help me for this?
I didn't get working plugin yet.
cordova.plugins.notification.local.registerPermission(function(str) {
console.log('Push Permissions:'+str);
setTimeout(function () {
cordova.plugins.notification.local.schedule({
id: 10,
title: "yo test in 15 minutes!",
text: "test test test",
badge: 1,
data: { yo_payload:"yo data" }
});
}, 1000);
});
I got console.log('Push Permissions:'+str);
but notification is not working.
@sirius2013 Did you test in background mode ? juste click on home button and wait for notification.
yes, it worked.
worked when app is inactive.
@sirius2013 Ok, it's the normal result from this plugin. I think it doesn't work in foreground ...
I also have this problem. I've tried changing forks, but no lucky.
It is seriously worrying how the main repo of a really useful cordova plugin is having this kind of problems. I mean, it's not katzer's fault; he did more than I've done already, and took all of us here, but it worries me about hybrid apps.
Edit:
Guys, I've managed to get it working by removing the notification plugin along with "cordova-plugin-app-event", "cordova-plugin-badge", and adding acianti's fork (https://github.com/acianti/cordova-plugin-local-notifications).
The only problem I still have is not having actions (which I did, through a fork).
Didn't show notification overlay
Notification appeared in Notification centre
Shows notification overlay
Notification appeared in Notification centre
Didn't show notification overlay
Notification doesn't appeared in Notification centre
Shows notification overlay
Notification appeared in Notification centre
Looks like UNUserNotificationCenterDelegate needs to be implemented if we want the notification to appear at all when the app is running in the foreground.
https://github.com/katzer/cordova-plugin-local-notifications/issues/1084#issuecomment-249214914
Starting in iOS 10, you can now actually display the notification when the app is in the foreground by using the appropriate arguments in the completion handler in the UNUserNotificationCenterDelegate
I will wait for plugin update have foreground working feature on iOS like android.
I got it working on iOS10 with
cordova plugin rm de.appplant.cordova.plugin.local-notification --save
cordova plugin add https://github.com/spk0611/cordova-plugin-local-notifications#9ad32cf2059cdf9a54b4930b1c58ba76ef7e3a87 --save
Hi,
Anything for foreground ?
Thanks
@shivam5x You can show alert inside app when in foreground. Currently, it isn't showing in notification centre for iOS 10, when app is in foreground.
cordova.plugins.notification.local.on('trigger', function (notification) {
// show alert here
})
@shivam5x no foreground...
@spk0611 with this fork the method cordova.plugins.notification.local.getTriggeredIds, does not work
I am working on it already. I haven't yet done any commits but the new version will not be compatible anymore with iOS 9 because of the new UserNotifications API.
@katzer no way to keep backward compatibility ?
@katzer any change incorporate actions on the release? I've been using actions on my app for almost and year now, and I've seen someone's Pull Request regarding this..
Would be a nice level up for the plugin!
@katzer Isn't it possible to check the OS version and then use different sources? Some older iOS devices don't support iOS10. And I guess it's a huge impact for some apps if you cut the compatibility.
Why is the old notification API (the one until iOS 9) not working in iOS 10 when it is "only" deprecated? I thought that deprecated things should remain working until the code is finally removed from (which if I understand correctly is not the case of iOS 10?) ...
While I admire this plugin is open source and free of charge and we all want to have it support iOS 10 breaking backwards compatibility may be a big problem for a lot of people... but surely I personally would prefer have iOS 10 running even at the cost of breaking backwards compatibility while hoping iOS 10 market share will grow rapidly.
@JLNNN The 0.9.dev branch contains support for actions for both iOS and Android. But might not fully work anymore with iOS 10.
@ammichael, @pa-de-solminihac, @kozuch even the old API is still available its not fully working anymore. The new API provides some new features and has also lost some features. Keeping backward compatibility means I have to maintain 2 complete independent code bases in one plugin. Thats out of my resources.
Might be an option to release one version with contains sources for iOS 9 & iOS 10. But after I will remove the old code.
I've just spent an hour or two testing, and with this version, I have notifications working on both iOS 9 and iOS 10. I only get notifications when the app _is not running_ on iOS 10, I guess it's an iOS change.
Thanks @katzer for the awesome plugin and @notclive for a quick fix for iOS 10.
@katzer Any chance of merging that change? It's pretty small and seems to work on both iOS 9 and 10 for me at least...
@chmac I know this fork. It's a quick way fixing some things. The current ios10-branch does similar.
@katzer I also tried the ios10
branch, but for me that didn't work. I was not seeing notifications on iOS 10. At least, that's what I remember! It might have been that I didn't realise notifications only show up when I'm not in the app, I'm not 100% sure at this point.
@katzer Would also be great to get the hotfix into the main branch, so that the plugin continues to work on iOS 9 and also works on iOS 10. I think I read the ios10
branch won't work on iOS 9, but maybe I misunderstood that.
+1
+1
I've updated the ios10 branch. It supports both iOS9+iOS10. Its still a work in progress but most things do work. It does not yet contain any new features provided by the new SDK.
The updated the ios10 branch of Cordova Local-Notification Plugin
https://github.com/katzer/cordova-plugin-local-notifications/tree/ios10
Hi,
I was using plugin for multiple lines - " cordova plugin add https://github.com/DavidBriglio/cordova-plugin-local-notifications " but suddently ios10 issue came
so i just installed your new updates of plugin - cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#ios10
It is working with older & ios10 device but multiple line not supporting in android device.
Please let us know what can we do in this case?
Thanks
Hi,
Is this correct command to install ios10 updated notification plugin -
cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#ios10 ?
@shivam5x Actually, I needed to download the repo and cordova plugin add the local directory
Thanks for the response @ammichael , can you please explain complete step to install plugin ?
@shivam5x
Yeap. Go to https://github.com/katzer/cordova-plugin-local-notifications#ios10, download the repository.
Now go to your download folder (or wherever you saved it), open your terminal, and type 'cordova plugin add ' (noticed the space?), drag the repository folder in your terminal. You should have the complete path to your repository folder. Just install it, and it should work fine
Will the ios10 update be available for phonegap cloud builder if I add the line (below) in the config.xml?
plugin name="de.appplant.cordova.plugin.local-notification"
If not how I should build the ipa for ios10 using this plugin.
We are using it for current release. Please help!!!!
@ammichael Thanks for the explanations. It worked for me
An trying to build cordova-plugin-local-notifications-ios10
using
cordova plugin add /Users/XXXXX/Downloads/cordova-plugin-local-notifications-ios10
Plugin "de.appplant.cordova.plugin.local-notification" already installed on android.
Installing "de.appplant.cordova.plugin.local-notification" for ios
Plugin doesn't support this project's apple-ios version. apple-ios: 9.3.0, failed version requirement: >=10.0.0
Skipping 'de.appplant.cordova.plugin.local-notification' for ios
and are getting
Plugin doesn't support this project's apple-ios version. apple-ios: 9.3.0, failed version requirement: >=10.0.0
Skipping 'de.appplant.cordova.plugin.local-notification' for ios
Setting deployment-target in config.xml doesn't seem to work either.
Do we need to be running Xcode 8 (GHe says with a heavy heart)? or is there a simple solution that Google can't provide?
Thanks
Rob
cordova plugin rm cordova-plugin-local-notifications
cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#ios10
OR
cordova platform rm android
cordova platform rm iOS
cordova platform add android
cordova platform add iOS
cordova build android
cordova build iOS
cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#ios10
Did all those and still had errors. We're current trying the 0.8.5-dev branch and working our way through things.
We have managed to get Xcode 8 working but we have so many upgrades of things its getting out of hand :)
Rob
We fixed
Plugin doesn't support this project's apple-ios version. apple-ios: 9.3.0, failed version requirement: >=10.0.0
Skipping 'de.appplant.cordova.plugin.local-notification' for ios
by installing Xcode 8. So far, things look OK, unclear if Xcode 8 was needed but seems to work for us.
Is there an ETA for the iOS 10 notifications fix?
@katzer since this is such an important and integral plugin to the cordova platform, maybe it would be a good idea to check if cordova developers are interested in maintaining it along with their other plugins (such as battery, etc). No offense of course, but it is apparent that you don't have the time to keep this plugin up to date
Hi @katzer @chmac
I use the iOS10 branch to replace my original version, it works fine in iOS 10 version, but it doesn't work on iOS 9. I spent one days trying to fix it, but it still doesn't work on iOS 9, SO can you help me and give me some suggestions.
Any help is welcome!
thanks!
I think there are numerous branches out there from @katzer and other people. The version of local-notifications we have called ios10 works fine on ios8, ios9 and ios10. I know because I've spent the week writing test cases and running them against all the iOS version as well as Android 5 and Android 6.
I'm not at my office now, so can't tell you exactly which version we are running but I'll update this tonight or tomorrow, but I can assure you that one version does work across 8, 9 and 10.
There is slightly different behaviour on IOS 10 which our testing found, specifically that the IOS10 getAll function returns local notifications AND application notifications. IOS 8 and IOS 9 doesn't have that behaviour. Its not a biggie for us as we simply filter them out based on a pattern. AFAIR thats the only difference.
Rob
@lichi0206 I posted a link that worked for us on iOS 9 and 10 above. That was as far as we got. It worked, we deployed and moved on...
@chmac Thanks! I try that fork, but it didn't work and I don't know why, but thanks for you reply.
@rwillett Hi, thanks for you reply, could you give me which branch you are using?
@katzer It works fine on ios10. Now, on ios9, I can receive the notification, but when I click the notification, nothing happened.
I added a breakpoint in the following code with connecting a ios9 device:
`/**
if ([notification userInfo] == NULL || [notification wasUpdated])
return;
NSTimeInterval timeInterval = [notification timeIntervalSinceLastTrigger];
NSString* event = timeInterval < 0.2 && deviceready ? @"trigger" : @"click";
[self fireEvent:event localnotification:notification];
if (![event isEqualToString:@"click"])
return;
if ([notification isRepeating]) {
[self fireEvent:@"clear" localnotification:notification];
} else {
[self.app cancelLocalNotification:notification];
[self fireEvent:@"cancel" localnotification:notification];
}
}`
and I scheduled a notification on ios9 device, and I can received the notification, but when I clicked the notification, nothing happened, and the xcode didn't enter the debug mode.
Looking forward to your reply,
Thanks!
I'm having troubles too. No matter what fork I try, it just doesn't work in iOS 10. Not even tried in iOS 9.
I use cordova badge plugin, and I'm starting to think it may be related..
The version we are using is
de.appplant.cordova.plugin.local-notification 0.8.5-dev "LocalNotification"
However I think there are different versions of this plugin floating around and all have the same version numbers. There may be version madness going on. However I could be talking bollocks. Its not clear to us which version we have which is poor code management from us
We think it was EV's version of IOS 10. Now we have to go and find out ourselves
Here's the md5sum of the plugin.xml
MD5 (plugin.xml) = f5ad30da40ed4ea10948fd33bedf509d
which is hopefully unique.
@rwillett Thanks for you quick reply. Actually, I tried to find the 0.8.5-dev branch a few days ago, but just find this version in the example branch, not thee real branch, so I plan to use it when I don't have any solutions.
but
@katzer
I was just solved my problem, but not smart way. I modify some OC code, and it was effective. Now, the notification and "click" event can both be fired on ios10 and ios9.
Changed Code:
#pragma mark -
#pragma mark Life Cycle
/**
* Registers obervers after plugin was initialized.
*/
- (void) pluginInitialize
{
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"10.0")) {
eventQueue = [[NSMutableArray alloc] init];
self.center.delegate = self;
} else {
NSNotificationCenter* notificationCenter = [NSNotificationCenter
defaultCenter];
eventQueue = [[NSMutableArray alloc] init];
[notificationCenter addObserver:self
selector:@selector(didReceiveLocalNotification:)
name:CDVLocalNotification
object:nil];
[notificationCenter addObserver:self
selector:@selector(didFinishLaunchingWithOptions:)
name:UIApplicationDidFinishLaunchingNotification
object:nil];
}
}
Thanks again, @rwillett
Good luck with you job!
I think the branch names are all confused. We didn't download the 8.5-dev branch but the ios10 branch.
What we're going to have to do is download every ios10 branch we can find and diff the files to work it out.
We need to get some structure on these branches and what actually works and what doesn't. Not sure how to do it, the last thing we need is another ios10 fork.
Rob
For those who might be new at this the command is:
cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#ios10
or
ionic plugin add https://github.com/katzer/cordova-plugin-local-notifications#ios10
This will install from ios10 branch.
To verify, when you type cordova plugin
you should see the following line listed: de.appplant.cordova.plugin.local-notification 0.8.5-dev "LocalNotification"
.
As of Dec 4, 2016 that's the latest version.
So, my issue might be related to this somewhat, but I have installed the above version and I can create a notification that is set to repeat.
If the app is in background, it fires, BUT it also REMOVES the repeating notification from the getAllScheuled() return. Therefore when a user schedules a notification to repeat daily and they go to the view where their notifications are displayed (and where they can manage them, delete edit), it is GONE. As if it was removed, BUT the next day at that time, it will indeed send the notification to the user.
So, the ability to create repeating notifications (Daily reminders) using the app is now gone on iOS (at least if you want to allow the user the ability to manage them). On android (Of course) all works as designed. How can I keep the notification from being removed from the getAllScheduled() result? Without this, I'll have to abandon use, and I love this plugin.
I would check the behaviour on IOS 8/9 vs IOS 10. We don't use repeating notifications but there are differences in behaviour and the information returned. We have distinct code paths for different IOS versions in our notification handlers.
Why can't you replicate repeating notifications using one off notifications and then doing the repeat yourself.
We constantly query the local notifications and update depending on what we find. Some of our local notifications have a very short life span (minutes), some are designed to last two days. We use simple one-off notifications and manage the repeat ourselves.
Not sure what you are going to use to replace this plugin. If there's a better one, let us know.
Rob
Thatās what sucks, is I will have to remove the functionality from the app (or take a month to code one up as Iām not an Objective C programmer).
So, just a question, the āeveryā property that is passed on scheduling, does that not create a repeating notification on iOS according to what value they send?
Why can't you replicate repeating notifications using one off notifications and then doing the repeat yourself. ā How would I do this from javascript standpoint? How would I store the users āRequested Repeat Timeā and then fire that notification at that time daily at that time? And then allow them to remove said notification? Perhaps pouchDB to store the user data and then return it back to the UI?
Any help greatly appreciated.
From: Rob Willett [mailto:[email protected]]
Sent: Thursday, December 08, 2016 4:34 PM
To: katzer/cordova-plugin-local-notifications cordova-plugin-local-notifications@noreply.github.com
Cc: Billy Goforth bgoforth@maxor.com; Comment comment@noreply.github.com
Subject: Re: [katzer/cordova-plugin-local-notifications] iOS 10 notification problem (#1096)
I would check the behaviour on IOS 8/9 vs IOS 10. We don't use repeating notifications but there are differences in behaviour and the information returned. We have distinct code paths for different IOS versions in our notification handlers.
Why can't you replicate repeating notifications using one off notifications and then doing the repeat yourself.
We constantly query the local notifications and update depending on what we find. Some of our local notifications have a very short life span (minutes), some are designed to last two days. We use simple one-off notifications and manage the repeat ourselves.
Not sure what you are going to use to replace this plugin. If there's a better one, let us know.
Rob
ā
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/katzer/cordova-plugin-local-notifications/issues/1096#issuecomment-265876269, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AM_s3wxeu33akU72fH7rQz7RI5qXqB0Tks5rGIXugaJpZM4J8ec0.
The Maxor National Pharmacy Service Company e-mail system has made the following annotations;
This message contains confidential information and is intended only for the individual(s) addressed in the message. If you are not the named addressee, you should not disseminate, distribute, or copy this e-mail. If you are not the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited.
If you have received and/or are viewing this e-mail in error, please immediately notify the sender by reply e-mail, and delete this e-mail from your system. Thank you.
@billycomic
I donāt personally use repeating notifications, I compute a distinct fire date and time for each one and schedule them as an array using the at: parameter. And it works well and reliably. You do have to be a little careful as iOS only allows you to schedule 64 local notifications at any given time.
I deal with the 64 notification limit by cancelling and rescheduling all notifications when the app resumes or launches. We figure that if the user gets 64 notifications and still doesnāt open the app, theyāre not terribly interested anymore. This wonāt be true for all apps, but for ours itās acceptable. If youāre worried about the time it takes to cancel and reschedule, itās in the 10s of milliseconds.
On Dec 8, 2016, at 3:02 PM, billycomic notifications@github.com wrote:
Thatās what sucks, is I will have to remove the functionality from the app (or take a month to code one up as Iām not an Objective C programmer).
So, just a question, the āeveryā property that is passed on scheduling, does that not create a repeating notification on iOS according to what value they send?
Why can't you replicate repeating notifications using one off notifications and then doing the repeat yourself. ā How would I do this from javascript standpoint? How would I store the users āRequested Repeat Timeā and then fire that notification at that time daily at that time? And then allow them to remove said notification? Perhaps pouchDB to store the user data and then return it back to the UI?
Any help greatly appreciated.
From: Rob Willett [mailto:[email protected]]
Sent: Thursday, December 08, 2016 4:34 PM
To: katzer/cordova-plugin-local-notifications cordova-plugin-local-notifications@noreply.github.com
Cc: Billy Goforth bgoforth@maxor.com; Comment comment@noreply.github.com
Subject: Re: [katzer/cordova-plugin-local-notifications] iOS 10 notification problem (#1096)I would check the behaviour on IOS 8/9 vs IOS 10. We don't use repeating notifications but there are differences in behaviour and the information returned. We have distinct code paths for different IOS versions in our notification handlers.
Why can't you replicate repeating notifications using one off notifications and then doing the repeat yourself.
We constantly query the local notifications and update depending on what we find. Some of our local notifications have a very short life span (minutes), some are designed to last two days. We use simple one-off notifications and manage the repeat ourselves.
Not sure what you are going to use to replace this plugin. If there's a better one, let us know.
Rob
ā
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/katzer/cordova-plugin-local-notifications/issues/1096#issuecomment-265876269, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AM_s3wxeu33akU72fH7rQz7RI5qXqB0Tks5rGIXugaJpZM4J8ec0.The Maxor National Pharmacy Service Company e-mail system has made the following annotations;
This message contains confidential information and is intended only for the individual(s) addressed in the message. If you are not the named addressee, you should not disseminate, distribute, or copy this e-mail. If you are not the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited.
If you have received and/or are viewing this e-mail in error, please immediately notify the sender by reply e-mail, and delete this e-mail from your system. Thank you.www.Maxor.comhttp://www.maxor.com
ā
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
@Tawpie has explained it very well. You reschedule when the user starts up or resumes the app. Thats exactly how we do it.
We have to do this as we have a number of different types of notification:
We have two different types of payment notifications. These are generated locally by the app. We send these out over a) the course of one day for one type and b) over two days for a second type. These are important and MUST be seen. We only allow the user to delete them two hours after they have been sent If the user does delete them, we reschedule them.
A silent IOS/Android remote notification that tells the app there is some remote information ready. The app gets the information and displays it using a local notification. These are transient and change every 3-5 mins as they display up to date traffic information.
A remote notification that is sent when the app is suspended (the timescale of which varies from around 10 secs after the user puts the app into the background to 15 mins depending on IOS version. We have seen IOS 10 suspend background processing almost immediately, whereas IOS 8.9 can take 10-15 mins).
Every time the user resumes or starts the app, we query and generate the notifications again as needed to ensure the user gets the right information. Android is pretty consistent, but we have distinct code paths for IOS 8/9 and IOS 10 as the local notification queryAll returns different results.
Its a pain and if we look through the size of the code for all our sections, the notifications code is the largest section with the most shims and separate code paths for different IOS versions.
Here's the line count for our different files. These do have comments in as well, but you can see that the notifications section is more than 50% larger than the gps code we run and our app lives on GPS. perimeter.ts is where we generate custom geofences using city sized complex polygons. Thats a lot of complex code and thats tiny compared to services_notifications.ts.
1589 controllers_summaryctrl.ts
1637 controllers.ts
1859 perimeter.ts
1861 services_gps.ts
3094 services_notifications.ts
We have really had to think through just about every element of our notification code as its difficult and IOS is fairly immature compared to Android notifications. However the only thing worse than using this plugin is NOT using it. There's a massive amount of work needed to replace it, circa 12-18 months in our opinion to get back to where we are now. The maintenance cost is also enormous.
I think writing repeating notifications in JavaScript using one off local notifications should be pretty simple, certainly compared to writing it all in Obj-C.
Rob
I also use repeated notifications, and I'm also having trouble. Yeah, I know we can handle notifications without the 'every' attribute, but in that case, I think it should be removed so developers know upfront they will need to handle it manually.
It's confusing to give the option to use something that doesn't work anymore.
I've delayed an update for almost two months now, mainly because of the problems with this plugin. Notifications are core in my app, and I need them to works perfectly fine, or the app loses its point.
@Tawpie How do you deal with cancelling the notifications. Your method seems viable so long as the user is able to cancel all of them as well. If the user wants to cancel them, do you just look at the "at" value and cancel all of those notifications?
@billycomic Hereās our code, I just do cancelAll. Notice I do the rescheduling in the callback for the cancel to ensure that cancellation is ādone doneā before I go back in.
`// and finally schedule the reminders
const iStartTime = new Date().getTime();
if (gaMultiRemindersForKatzerLNPlugin.length) {
setTimeout(cordova.plugins.notification.local.cancelAll(function scheduleAllRemindersViaKatzer() {
console.log("ANSLMH.fQLM - cancellation completed. Elapsed: " + ((new Date()).getTime() - iStartTime) / 1000 + " secs");
console.log(" ANSLMH.fQLM - scheduling >" + gaMultiRemindersForKatzerLNPlugin.length + "< local remindersā);
cordova.plugins.notification.local.schedule(gaMultiRemindersForKatzerLNPlugin);
}), 1);
} else {
console.warn(" ANSLMH.fQLM - there were no reminders in gaMultiRemindersForKatzerLNPlugin to schedule");
}`
The setTimeout may not be required, I had it in there way back in the day when we did notifications differently and felt that starting a new thread was important to avoid blocking the UI (the old way we did it was quite slow on Android).
On Dec 12, 2016, at 6:54 AM, billycomic notifications@github.com wrote:
@Tawpie How do you deal with cancelling the notifications. Your method seems viable so long as the user is able to cancel all of them as well. If the user wants to cancel them, do you just look at the "at" value and cancel all of those notifications?
ā
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
@Tawpie I have built my schedule function to take an array of scheduled items that fire at the same time, but just the next day and I schedule them. I see them all coming back when I call getAllScheduled() and now I don't get any firing. I see that they scheduled, but when time elapses, no notification, whether the app is foreground, background, closed, or if device is locked. Any ideas? Thanks for the help.
B
@Tawpie The setTimeout isn't needed in your code. We used to have that code pattern and we removed them a few months ago as it actually seemed to introduce problems. We used to think that was the right approach but we no longer do :)
@billycomic. There are so many things that could be going wrong, its impossible to say whats wrong without seeing code. I can say that we have notifications that are designed to fire the next day. They do fire whether the app is foreground, background, closed or device is locked. We check for all of those conditions.
Rob
Rob
@rwillett OK.
Thanks for the assistance, much appreciated.
Here is the array that I'm passing into the schedule();
[{title: "Athens", text: "Test", id: 1, at: Thu Dec 15 2016 14:00:17 GMT-0600 (CST)}
{title: "Athens", text: "Test", at: Fri Dec 16 2016 14:00:17 GMT-0600 (CST), id: 2}
{title: "Athens", text: "Test", at: Sat Dec 17 2016 14:00:17 GMT-0600 (CST), id: 3}]
Here is the code that builds the array and then sends to the schedule function:
`
var time_to_notify = $scope.timeFromPicker;
var reminderId = 0;
if(isIOS){
var notificationItem = [];
for(i=0; i < 3; i++){
var iOSNotification = {
title: mxAppConfig.RegionId,
text: task.msg
};
if (notificationItem.length == 0) {
if (i > 0) {
var convertDate = new Date(time_to_notify);
convertDate.setDate(convertDate.getDate()+1);
time_to_notify = convertDate;
iOSNotification.at = time_to_notify;
}
reminderId++;
iOSNotification.id = reminderId;
iOSNotification.at = time_to_notify;
} else {
var convertDate = new Date(time_to_notify);
convertDate.setDate(convertDate.getDate()+1);
time_to_notify = convertDate;
iOSNotification.at = time_to_notify;
var reminderId = notificationItem.length;
reminderId++;
iOSNotification.id = reminderId;
}
notificationItem.push(iOSNotification);
}
$cordovaLocalNotification.schedule(notificationItem).then(function (result) {
$scope.closeModal();
$scope.getNotificationIds();
$scope.getAllScheduledItems();
task.id = "";
task.msg = "";
});
}
`
I have imported the library specified above, and it builds and I can schedule notifications on iOS devices running iOS 9.xxx but I get the following error in xcode console when building out to iOS 10 device.
Error:
[1444:2608775] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
Has anyone experienced this? I have tried every suggestion I can find on SO and Google. Super frustrating.
THanks
B
Just FYI, I have had to opt to use the calendar plugin on iOS due to the limitation of 64 notifications being able to be scheduled. Our users don't always return to the app within that time frame and the notificaitons would die due to that limitation. Also, if someone creates multiple reminders, that 64 notification limit is now split amongst the number of reminders created by the end user. Just not usable in my project. Hopefully, iOS will loosen this restriction in a future release.
I am also using the same plugin for local notification. It was working fine with iOS9 devices, as I updated my device to iOS10 notifications not working. I have tried all the solutions suggested in this thread. It will be helpful if someone could share any latest update on this.
Thanks
Manoj M
It's funny, but when I updated to ios10 branch it worked for a while and then stopped. Now reinstall the app doesn't make any difference, remove and install the plugin again didn't work. First I thought it was related with the cordova badge plugin, but removing it and installing the ios10 branch didn't change a thing too.
So frustrating :(
@ammichael
2 month ago..u tell about a fix...in that time u not updated the OS
@manojmohanan23
Yeah I did! I've been working in a huge update, and at the time I was already having problems with notifications, and seemed to be resolved with the fix I've posted here, but, like I said, it just stopped working suddenly, with no changes whatsoever in notifications service.
Since I had tons of other features to implement, I postponed fixing this issue hoping it would be fixed in the near future. But it is not yet
@ammichael
Thanks
https://github.com/katzer/cordova-plugin-local-notifications/tree/ios10 this issue already fixed, please check, working fine
Seriously, nothing works for me. If I use Telerik's version the on schedule event is triggered, but no notification at all.
If I use ios10 branch, it doesn't even trigger on schedule event.
ā¹ļø
The iOS 10 branch was working for me three months ago. Now I set up new hardware from scratch and changed small things, but it is not working anymore :-( I use Xcode Version 8.2.1 (8C1002)
Doesn't look like the ios10 branch has changed.
What versions of IOS are people using?
I'm using 10.2
I am using 10.2 (14C92). On the Simulator 10.2(15C89) I can hear a sound after 5 seconds, but nothing more.
Hi all. I found the issue. It seems that it is necessary to set the text attribute. I used only the title in the past.
This is working...
$cordovaLocalNotification.schedule({
id: 666,
title: 'Test',
text: "Diese Mitteilung erscheint als Test nach 5 Sekunden.",
at: _5_sec_from_now
});
This is no longer working...
$cordovaLocalNotification.schedule({
id: 666,
title: 'Test',
at: _5_sec_from_now
});
Would be good to know if that fixes the problem.
I'm just doing a build for the simiulator for 10.2.1 to try this out. We use the text:
attribute anyway so we may never have noticed the issue.
Rob
We've just tested this on 10.2 (14C89) and the same code we already use works for us.
We made no changes whatsoever for 10.2 (14C89), though we did already have a test attribute.
Rob
Yes, I can confirm that this branch works on iOS 10.x
ionic plugin add https://github.com/katzer/cordova-plugin-local-notifications#ios10
Here is my code for ionic2:
Import "LocalNotifications"
import { LocalNotifications } from 'ionic-native';
Setup delayed notification after 5 sec. (You can execute below code on a button click and send your app to background and notification will be triggered after 5 sec.)
LocalNotifications.schedule({
id: 1,
title: "Test Title",
text: "Delayed Notification",
at: new Date(new Date().getTime() + (5 * 1000))
});
Well, I've started asking whether the problem was the plugin or even my phone. Maybe something corrupted or whatever.. But I've tried in simulator and I've got the same behavior:
I had similar code to test the notification as you, @suryakand, and the notification is triggered just for the first time. So the app asks for permission, I grant it, receive notification. When I reopen the app.. Nothing.
Dude, this is so frustrating!
@ammichael
I think this thread is getting too confusing with too many people involved with too many different issues. I'd suggest you start a new clean thread with exactly what the problem is with as much information as possible. I wouldn't link to this thread but put all the information in the new issue and work from there.
I've tried to follow whats going on in this thread and have now given up and will no longer contribute to this thread as its so difficult to trace whats happening.
Rob
Try this https://forum.ionicframework.com/t/ios-10-strange-problem/63916/6
**
Notifications work in iOS 10
** , after and later :)
@faisalalfareza for a moment it gave me hope ā¹ļø
When I activated it in my xcode, I really though that maybe it was gonna be just that hahhaha
Well, nope. It behaves just like I mentioned in my op. Notifications fires just the first time the app opens, when the permissions are asked. I'm gonna run some more tests today and I'll try and find more clues of what is happening.
@faisalalfareza that thread is centered around push notifications. This thread is centered around local notifications. They are actually two different sets of functionality and handled differently. Enabling push notifications through xcode has no affect on local notifications.
@billycomic Hey, how have you handled the 64 notifications limit? I think my case is somewhat like yours, where users don't need/always return to the app.
I'm trying to schedule 480 notification, but I can't hahaha
@ammichael Unfortunately, in my case, there is no work around. The 64 notification limit (and split that for each notification) makes it unusable in my use case. I had to make a change in behavior and provide a different code path for iOS only to use the Calendar Cordova Plugin and then I'm able to store repeaters and it actually adds some nice controls from a user standpoint.
I love the local notifications plugin, but unfortunately, iOS has cracked down on how they are used. Hope that gives you some direction.
@billycomic That is really, really bad. If I split the notifications by the limit it would give me 4 days of notifications; far from being enough in my case.
I've taken a look at Calendar Plugin, but that won't be useful in my case.
Not sure what to do, to be honest ā¹ļø
I'm having troubles getting the plugin to work in iOS. I've installed the iOS10 branch, but the notifications don't appear on iOS10. Any recommendations?
@RainierMallol
Please do not hijack threads. If you have a problem raise a new issue using the template in #1188 with code.
I am able to send local notification , but issue is its not showing in notification center.Its just come and disappear. Any solution for this?
Hi all
Now i am using https://github.com/katzer/cordova-plugin-local-notifications#ios10 and it works fine on simulator, i get notification when the app is running in background.
However, on the real device, i cannot receive notification in background. The notification arrive when i open the app.
Anyone have idea?
Thanks!
@testingfhcp
Don't hijack threads. Raise a new issue using #1188.
Hey Guys,
i do not get the notification work on ios 10
i use the plugin @testingfhcp recommended, (i think it does fire the notification in objective c) but i do not get any notification in my notificationcenter
did anyone can help me? :-(
here is my code to test the local notification
maybe the issue is there?
var now = new Date ();
var testdate = new Date (now);
testdate.setMinutes(now.getMinutes() + 1);
if (this.localNotifications.hasPermission()) {
this.localNotifications.schedule({
id: 4,
title: 'YEHA!',
text: 'Successfully sent a notification!',
at: testdate,
every: "second",
sound: null
});
this.notificationTest = "tried to trigger notification!";
} else {
let alert = this.alertCtrl.create({
title: 'Permissons',
subTitle: 'You do not have permission to send notification',
buttons: ['OK']
});
alert.present();
}
Try without "every". That option has known problems. And make sure you have the at time set into the future enough that the OS can finish secheduling and you have a chance to quit the app. As you know, by default iOS does not fire local notifications when your app is in the foreground.
@Tawpie thank you so much :-)
i tried so much parameter during the original plugin and forgot to remove this one from this branch :-D
you are my rescue, it does work
thanks a lot
i think this parameter does make trouble because it is not a standard feature of ios
when application is in background mode ios 10 local notification not working any help?
I am new to ionic and mobile app, but for you guys reference.
i am using https://github.com/katzer/cordova-plugin-local-notifications#ios10 with below code
LocalNotifications.schedule({
id: 1,
title: "",
text: "",
at: new Date(new Date().getTime() + (1 * 1000))
});
it works fine on ionic 2 with ios10.3.1 (14E304)
@jd0048
Don't hijack other peoples issues. Raise a new one.
Please use 0.9-beta for iOS 10 and above. Thanks
Maybe this is a dump question. Is it possible to use 0.8 and 0.9-beta in the same app to support ios10+ and ios < 10? or what is the best way to support both older and newer ios versions?
Most helpful comment
@katzer any chance to have a clean release for ios 10 ?
As a ionic user i'm really blocked outthere :(