APN Push Notifications coming in bursts - ios

I'm developing an iOS app and I'm facing this weird bug where the push notifications come in bursts.
Basically, let's say I send 10 push notifications with APN from a server (my logs show that the push notification sends), but I don't receive it until some arbitray time later, when I receive all 10 notifications at once.
I've double-checked my app-side code and have also tried re-generating/re-uploading the p12 certs and after looking around here, I haven't managed to find anything either./
Would anyone be able to shed some light on this? Any help is appreciated!
*UPDATE: my logs show that every time the server sends a push notification, it also sends a 'apple sandbox notification' simultaneously, but I'm notsure what that is

Related

How to receive remote notifications after iPhone comes back online?

I am currently building a laravel provider service to send push notifications to IOS devices. I have followed this tutorial for creating a sample app which is able to receive notifications.
On my server side, I used this package to handle push notifications.
During testing, the app manages to receive push notifications when the device is connected to wifi/4G, during foreground/background/inactive modes. However if I send the push notification to the app when its offline, on connecting the device back to the internet I do not receive any notifications.
According to the apple documentation, the APNS service stores any notification which is sent when the device is offline and delivers it to the client after connection is re-established. It is supposed to dispose of any notifications if the device stays offline for a long time (duration not exactly specified). However I am keeping the device offline for only a minute before going online. Can anyone please suggest a solution?
Thanks to Brandon I managed to know what the problem actually was. The next challenge I faced was how to integrate the expiry period for the notification in the message payload using the davibennum/laravel-push-notification package. Since there was no documentation regarding this, I had to go through the source code to find out how to define the expiry period. Turns out the expiry time can be set simply by defining it like this in the message payload:
'expire' => Carbon::now()->addDays(30)
Basically you are passing a date time instance, which will then be transformed to the apns-expiration header of the request.

is there a limit when sending push notifications to multiple iOS devices?

So, I have about 1000 iOS users installed my app.
I tried to send push notification to these users thru my app's backend panel, however, my devices did not receive the push notification. I also asked some users, and some of them said they did receive the push notification and some did not.
I was wondering why not all of the 1000 iOS users receive the push notification successfully.
At first, I thought it has to do with my applications, because my device has the latest update that is yet to release to public. So I went on and delete all the device tokens I got, and register my device again to test the push notification.
This time, my device received the push notification from backend panel successfully. So, I am sure there is nothing wrong with the coding part on receiving push notifications. (I ran multiple test on this and sure that push are send and receive successfully)
It only happens when I tried to send bulk push notifications to iOS users.
so, is sending push notification has a limit? like it only allows to send may be to 100 users?
or may be there are invalid device token so that pushes are stopped before finish sending to all users? but in what situation device token become invalid? will uninstalled user's device token may be a cause?
In our experience notifications have far from a 100% delivery rate, and that's with only between 50 and a 100 installs across iOS. In theory there is no cap set in place.
The only limits I'm aware of is sending an identical notification to the same device multiple times within a short window of time.

What happened with registered devices those turned off their notification in iOS

I googled but not able find my desired solution. My Questions are following related to push notification.
What if registered device turned off its push notification and server broadcast notification. Is notification place in waiting list (e.g when device turned on notification it gets notification) ? or Reject ? or Server keep sending ?
If server keep sending how to tackle this situation, I mean is there any way that we can find our some client turned off notification then we'll not send notification to APNS?
If someone already asked then kindly reference those question instead of down vote.
Looking for answer. Thanks
APNS docs here: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html#//apple_ref/doc/uid/TP40008194-CH8-SW1
Your server - what Apple calls the provider - maintains a list of device tokens that have registered for your notifications.
When a device turns off push notifications, you should remove its device token from your list.
So far as I know, if you attempt to push to a device that has turned off push notifications, your provider will receive an error, and the push notification will not be queued. It should be easy enough to test using a device.

iOS push notification coming twice

I am using the one signal third party sdk to send push notification, for this, i had created ssl certificate and export p12 to one signal dashboard.
For some reason my own server need to send push notification for this I have created another SSL certificate and give pem to the my server side.
Once my server send push notification, one signal also send push notification, what is issue anyone suggest me to solve this type of problem.
How to solve this type of issue.
OneSignal is designed to never deliver the same notification to the same device, so it seems like the likely cause of this issue is that you are delivering the notification twice yourself (once through your own server, and then another time through OneSignal).

iOS remote notifications not showing outside app

The strangest thing has been bothering me for ages now. When sending a push notification from our sandbox environment the system receives the notification only when the app is in the foreground. Exiting the app and sending a push notification doesn't show a badge or alert.
These are the steps i've taken so far:
Re-created the provisioning profile after generating the SSL.
Made sure that the correct capabilities are in place.
Verified that a device token is registered
Does anyone have any idea what could be the problem here? Why would the push notification get received inside the app, but not outside?

Resources