-
Notifications
You must be signed in to change notification settings - Fork 325
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
IOS scheduled notification #16
Comments
iOS still in development. But anyway, it will not be possible to make complex schedules on iOS, due the operational system limitations to run background tasks. IOS does not respect time schedules and runs whatever it thinks it should, when it thinks it should. Sometimes it even executes. Ill put on README more explanations about it on next releases. |
tnx man, but a normal scheduling, like every week? or every day? is possible or not? |
Depends, and that is the problem. On iOS, the notification schedule is made before the notification itself beeing created, and only offeres support to a few schedule types:
If you try to "improve" that limitation, you gonna fall in a serious problem: If you create a new schedule to a notification id already scheduled, you gonna replace the old one. So, if you use random numbers or a subproduct id method to allows you to send the same notification with different IDs, youll fatally gonna falls on "cartesian product" combination, wich can easly produces a huge number of duplicated notifications scheduled on the system (and iOS only supports the maximum local notifcation scheduleds to 64).
Unfortunely, the only method to receive the notification before displays it is using "willPresent" method, but it only works on foreground. So, its not possible to process correctely the next schedule as soon as it displays. Because of that, schedules on iOS works perfectly only on foreground, but not on background or even when the app is killed. And also unfortunely, there is no way to create a superclass to extends the default schedules and offers a more powerful and complete solution. Background process are another problem. They run when they think its ok to do, and almost never respect the schedule parameters. They are two types:
If any of above conditions was different, i could perfectly schedule the notifications, as i do on Android. But until the moment, i couldnt find a satisfatory solution. |
I've oppened a Apple's support ticket to resolve this issue. Let's see if it is possible to solve it. |
Hi! Could we please have more clarity on which scheduled notifications work and which doesn't work exactly on iOS? E.g.:
Thanks! |
They never improved the notification for iOS. So, ive downgrade the schedules for both platforms and keep a crontab working on 0.6.14 version. Please take a look. |
Has there been any update on this topic? |
No, they never changed it. |
hi, I'm trying to use scheduled notification on iOS, on android all chrono function works well, but on iOS dont work
this is the function that I tried:
Future<void> repeatMinuteNotificationOClock(int id) async { await AwesomeNotifications().createNotification( content: NotificationContent( id: id, channelKey: 'schedule', title: 'Notification at exactly every single minute', body: 'This notification was schedule to repeat at every single minute at clock.', ), schedule: NotificationSchedule( crontabSchedule: CronHelper.instance.minutely(initialSecond: 5))); }
if I schedule with this all work perfectly, but this dont repeat notification:
await AwesomeNotifications().createNotification( content: NotificationContent( id: id, channelKey: "scheduled", title: title, body: 'xClock è tempo di $title', payload: {'uuid': 'uuid-test'}), schedule: NotificationSchedule(initialDateTime: delayed.toUtc()));
The text was updated successfully, but these errors were encountered: