Is there a limit to notifications?
For example, if I move 30 messages to another folder, I get 30 notification with a clientState of update. If I move more than 30 messages, I'm not getting any notifications.
How many updates can I make per second to get all notification?
Related
I have an app that allows users to create recurrent events. Each one of the events may or may not have reminder/alerts at a specific time of day. If they have so, the app sends a local notification at that time of day.
Events are stored in CoreData.
Event(name: "Go to London",
date: 2020-04-03 21:40:55.419925+0200,
reminders: [2020-04-03 20:00:00.419925+0200,
2020-04-03 10:00:00.419925+0200,
2020-04-03 12:00:00.419925+0200]
)
An event may occur on each day of the year or everyday for the next X years.
A user may create unlimited number of events per day. And hence, the total number of notifications to be sent can easily surpasses 64 (total number of local notification that you can schedule in iOS). So I can not schedule all the notifications while the app is in foreground.
I need a mechanism to periodically schedule notifications if there are less than 64 notifications pending. This should be done even if the app is in the background.
I would be happy if you provide a solution or guide me towards finding a solution for this scenario.
info
I tried to set up a Timer that periodically checks total number of pending notifications and their due dates. . But it did not work, because timers won’t fire once the app goes in background.
I am not sure if I understand your problem right. But my impression is the following:
Your users set up and update a database of events where each event has a certain date and time.
They do this simply be entering new events into the database.
It is easy then to fetch the first n (say, 10) events from the database.
It is required to fetch more than one, since the delivery of a local notification is not guaranteed, see the docs:
Every attempt is made to deliver local and remote notifications in a
timely manner, but delivery isn't guaranteed.
Register these n local notifications with the notification center, and cancel any notification for events that are no longer among the n next ones. The docs say:
Typically, you cancel a request when conditions change and you no
longer need to notify the user. For example, if the user completes a
reminder, you would cancel any active requests associated with that
reminder. To cancel an active notification request, call the
removePendingNotificationRequests(withIdentifiers:) or
removePendingNotificationRequests(withIdentifiers:) method of
UNUserNotificationCenter.
So, even if your app is in the background or suspended, the local notification will wake it up, handle the event, remove it from the database, and update the n next events. Even if a notification could not be delivered (which is not probably, but possible), you could handle the missed event, and schedule the next ones.
I hope this meets your requirements!
Have you tried the background fetch feature? Official document link here.
And in my opinion, it would be better to use remote notification, just setup a simple server to store the users' data.
After registering to webhook subscription for mail or user resources - What is the expected time between a change occur till our subscribed endpoint will receive the change notification?
The time to deliver notifications varies depending on the service load and other factors. Under normal conditions you should receive notifications within 5 minutes of the actual change.
I am trying to understand what is the limit for push notification per hour assuming I do not show the user a message, only update data on a terminated app, to move some small critical calculation from a server to the phone.
So for example if I want to update a device on a value that's being changing all the time, and say I want to inform the phone on a new value every 1-3 minutes , or even 10 minutes, wake up and calculate something and decide if I should alert the user.
Reading many posts like is there a limit when sending push notifications to multiple iOS devices?
did not provide a clear answer.
Is it something popular to inform a device every 10M ? is it a good practice ? do large companies do that ?
It seems that here :
https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_updates_to_your_app_silently
Apple says you allowed to send 2 Silent Notifications per hour, and it works only when the app is in the background.
When you send real push notification which inform the user on the lock screen, then you can send how many you like (which is pretty strange because both use the same resources from Apple exactly, and on silent notification I even provide better user experience by filtering some of the notification from alerting him, so its not clear why when the user is being alerted you can spam him but when a server update an app in the background - you have a limit )
If you use Remote Notification (silent notification) you have a limit per hour maximum 3 notification you can receive or send.
Silent Notification.
If you want to update your app in background or even if it is killed, without limitation of Push, you can use UNNotificationServiceExtension in order to download something from your serve or you can implement some value to share with your main app, then when user open your app, you can refresh it.
I'm working on a sync server that keeps the Office 365 events and my calendering app in sync. I subscribed to a push notification for user's event calendar that has a custom single extended property.
The documentation says if the sync server doesn't respond with a 2xx message, the notifications will be resent in periodic intervals. I tried by bringing my server down for some time and in this interval I did some changes to the events for which I was expecting notifications. Then I brought the server up again and it took some time(10-15 mins) for Microsoft to send old queued notifications.
Any idea what is the interval that Microsoft sends queued notifications when 2xx is not received?
I'm working on an app where I need to send a good amount of notifications to the user daily. Around 5-40 depending on the user.
I'm using local notifications to send it, but I know there is a 64 notification limit. Does this mean 64 notifications per day, or in total?
It means simultaneously scheduled for future delivery. You can send as many as you want per day, provided they don't overlap.
If you add more than 64 requests (under UserNotifications) or scheduled (under UIApplication/UILocalNotification), the older ones will be dropped and not delivered.
Unfortunately iOS limits the local schedule notification up to 64. May be to prevent this issue can schedule first group of notification initially and then schedule another group when launch the app next time.