The problem
Some APNS push notifications that I am sending from a server contain alert and sound, but they only cause the iPhone screen to blink momentarily, while no text is shown in the notifications section.
Context
Python and PyAPNS on the server side
Verified multiple times on iPhone 6, iOS 8
Did not find any consistency - the text of some messages appear, and other don't, with no pattern I could recognize
The payload size is less than 256 bytes. Furthermore, the problems also happens on iOS 8 which has a 2k limit - so it's probably not a payload size issue
Only one noisy (alert + sound) push was sent at the same time (thanks, Steve). There is a very slight chance that some silent pushes (no sound, no alert, contentAvailable=1 were sent at the same time, but that shouldn't bother the noisy one.
Any idea why some alert text do not appear in the notification bar?
I saw similar problems a short while ago with two scenarios:
18798969 Notifications that set a badge to 0 never appear!
Status: still open
Sent a notification and set the badge to 5. Then send another and set it to 0. The text is never seen (screen flashes briefly)
19238323 'content-available' notifications not delivered to my app
Status: Duplicate of 18645681 (Open)
If notification contains a 'content-available' value, and the WIFI signal is weak, it does not get shown or delivered. Move close to the router so you have a 5 bar signal, now it works.
Is it possible you are sending too many too quickly?
From the Technical troubleshooting guide:
Some Notifications Received, but Not All
If you are sending multiple
notifications to the same device or computer within a short period of
time, the push service will send only the last one.
Here's why. The device or computer acknowledges receipt of each
notification. Until the push service receives that acknowledgment, it
can only assume that the device or computer has gone off-line for some
reason and stores the notification in the quality of service (QoS)
queue for future redelivery. The round-trip network latency here is of
course a major factor.
Related
We have a Swift based app out on the App Store which includes a team messenger.
We experience issues on the deliverability of some background push notifications.
If we login with the same account on an iOS and Android device, all push notifications appear on the Android device while only some of the push notifications show up on the iOS device.
Based on this, the issue doesn’t seem to be related to the backend. Going through the Swift code, everything also seems to be fine - and we do also get some push notifications.
Setup:
We send push notifications directly from the backend (node.js) through APNS to
the iOS devices. We don't use any provider in-between (like e.g. Pusher).
Issue description:
Testing on 3 devices (fully charged battery, bluetooth turned off, do not disturb disabled, no apps installed which could block push notifications etc).
Device A: iPhone5 on iOS 10.3.3 - 7GB free space.
Device B: iPhone5 on iOS 10.3.3 - 9GB free space.
Device C: iPhone5S on iOS11.
Test on a slow wifi connection (even though a speed test shows 22Mbps download):
All push notifications with 10 characters went through on all 3 devices.
Push notifications with +20 characters were only displayed on device B + C.
Above +30 characters, no push notifications are received on device B + C.
Test on a faster wifi connection:
Same device A and B used. Device C not included.
Push notifications up to 497 characters are received and shown on both device A + B.
Push notifications above 509 characters are never received on any of the two devices.
Short messages (less than 10 characters) instantly sent after the “509 character message” are not received --> Seems like the notifications are temporarily blocked. After a minute or so, short push notifications (e.g. 10 characters) are received and shown again. All shorter messages are received and shown until we send a long message again which blocks the delivery of push notifications.
Test on the slower wifi connection again
- Now experiencing the same behavior as on the faster connection. Push notification with up to approximately 500 characters appear, while push notifications with more characters do not get through and seems to block the delivery of smaller push notifications sent afterwards.
Payload size shouldn't be the issue: Since we on Device A didn't receive push notifications above +20 characters on the slow wifi connection initially, but are able to receive push notifications with 497 characters on the same device on a faster wifi connection, I think we should be able to rule out that the issue is related to the size of the payload. Do you agree?
Can it be that the combination of these 3 parameters can have an impact on whether a push notification is delivered or not?
Length of message + speed of wifi connection + free space available
Any suggestion on how to solve this to ensure all push notifications are delivered, and avoid the temporary blocking/non-delivery we experience?
Thanks in advance,
Andreas
I'm working on getting background notifications to work on IOS with GCM - non-background notifications are already working.
In background notifications sometimes come and sometimes not.
I used conten_available = 1;
I successfully obtained a Registration Token and subscribe to topic:
Registration Token:
nU8ef5ZzonI:APA91bFaazXpqgI2wKTCujMaLLIZaKOmdpPAz2_WRc3V54d4eEI8p8VeAUZLwMAQ_8iaDDQ4XJAS44dFyIQkXcZ8cJjVdEGUEgnNOtrqxBKFHDTtPOUf2xT28vRprdStdVNzvrBFCQ3
Connected to GCM Sep 2 17:37:24 iPhones-iPad News[4201] : Already subscribed to /topics/news
But often in the backgrounds the application does not receive notification.
Or, the notification may come all at once old and new.
Why notification work so unstable?
You said "But often in the backgrounds the application does not receive notification. Or, the notification may come all at once old and new.".
Meaning not that they don't come, but they are delayed. Background pushes often are not immediate delivery and may take several hours.
If the user force quits the app they will not be delivered at all.
If you plug your iPhone into a power charger (or connect it to a computer via a charging usb cable) and try again you will most likely find they are delivered immediately. This is because starting with iOS8 background notification delivery is tied to power saving and hence why you will see them delayed and bunched together when they are delivered.
I'm trying to send a push notification to a device - which is longer than 255 characters.
I'm not getting any errors from Apple servers but the push notification does not reach my device.
Using Pusher (https://github.com/noodlewerk/NWPusher) the push notification DOES reach the device - using the same certificate.
Sending a push notification smaller than 255 characters DOES reach the device
What could be the issue?
Usually, push notifications that are too long, such as over 255 characters as you have mentioned do not make it into the user's device due to the fact that IOS might believe that these notifications are spam notifications. This also forces the developer to be as concise as possible, so the user can get the full information they need from just a quick glance at the screen of their device.
Also, take a look at the following thread.
According to documentation from Apple Push Notification Service:
Each remote notification includes a payload. The payload contains
information about how the system should alert the user as well as any
custom data you provide. In iOS 8 and later, the maximum size allowed
for a notification payload is 2 kilobytes; Apple Push Notification
service refuses any notification that exceeds this limit. (Prior to
iOS 8 and in OS X, the maximum payload size is 256 bytes.)
Is it possible to send multiple (10 - 15) notifications to the registered iOS users at a time / instantaneously ? What are the limitations for iOS Push Notifications ?
Is it possible to send multiple (10 - 15) notifications to the registered iOS users at a time / instantaneously ?
No you can not send 10-15 notification simultaneously to same user, read more here at apple docs .
If you are sending multiple notifications to the same device or
computer within a short period of time, the push service will send
only the last one.
However if you intend to send push notifications to different users at same time than it should be no problem (Which i guess is what you are looking for).
What are the limitations for iOS Push Notifications ?
If you are not sending them simuntanously to same user than there is no limitation for APN's push notification as mentioned here .Take a look at Push Notification Throughput and Error Checking
There are no caps or batch size limits for using APNs. The iOS 6.1
press release stated that APNs has sent over 4 trillion push
notifications since it was established. It was announced at WWDC 2012
that APNs is sending 7 billion notifications daily.
If you're seeing throughput lower than 9,000 notifications per second,
your server might benefit from improved error handling logic.
Here's how to check for errors when using the enhanced notification
format. Keep writing until a write fails. If the stream is ready for
writing again, resend the notification and keep going. If the stream
isn't ready for writing, see if the stream is available for reading.
If it is, read everything available from the stream. If you get zero
bytes back, the connection was closed because of an error such as an
invalid command byte or other parsing error. If you get six bytes
back, that's an error response that you can check for the response
code and the ID of the notification that caused the error. You'll need
to send every notification following that one again.
Once everything has been sent, do one last check for an error
response.
It can take a while for the dropped connection to make its way from
APNs back to your server just because of normal latency. It's possible
to send over 500 notifications before a write fails because of the
connection being dropped. Around 1,700 notifications writes can fail
just because the pipe is full, so just retry in that case once the
stream is ready for writing again.
Hope this helps.
If you are sending multiple notifications to the same device or computer within a short period of time, the push service will send only the last one.
Here's why. The device or computer acknowledges receipt of each notification. Until the push service receives that acknowledgment, it can only assume that the device or computer has gone off-line for some reason and stores the notification in the quality of service (QoS) queue for future redelivery. The round-trip network latency here is of course a major factor.
As described in the Local and Push Notification Programming Guide, the QoS queue holds a single notification per app per device or computer. If the service receives another notification before the one in the queue is sent, the new notification overwrites the previous one.
All of this points out that the intent is that a notification indicates to an app that something of interest has changed on the provider, and the app should check in with the provider to get the details. Notifications should not contain data which isn't also available elsewhere, and they should also not be stateful.
Any push notification that isn't delivered immediately was queued for future redelivery because your device was not connected to the service. "Immediately" of course needs to take latency for your connection into account. Outlying cases would be beyond 60 seconds as APNs will time out at that point.
for more info click here
I'm currently using Pushwoosh as my push notification provider for iOS push notifications. What I'm noticing is that it takes on average 10-15 seconds to receive notifications after they are sent out. What I want to know is if this number is a normal number given the amount of traffic that Apple receives to their APNS servers? What kind of speeds do you get using Pushwoosh or other services? Is it time to switch to something more reliable, or is this just the nature of APNS no matter what provider I go with?
Pushwoosh is very cheap and affordable, but I'm starting to realize you get what you pay for, and that's not quality.
There are several possible problems
Your connection to pushwoosh.Just ping Pushwoosh API gateway cp.pushwoosh.com
Some delays on pushwoosh side.Send message, then go to https://cp.pushwoosh.com/notifications and find your message in the list, it must be first from the top. Status of the message can be pending, processing or done. In pending status your message is not being sent right now. It means that pushwoosh servers are currently very busy(really rare situation). When status becomes "processing", pushwoosh starts sending notifications to APNS immediately. In normal situation you should receive notification before your message becomes "done" in pushwoosh control panel. if not, see 4
Device connection.Even if you are sure that your device is connected to the internet - check again. This is the most common problem with delays.
APNS delays.I do not know 100% way to diagnose this, but if message status in pushwoosh control panel is "done" and you are sure about (3), there are some delays on APNS.
P.S.
If my reply will not help, feel free to contact Pushwoosh support(http://www.pushwoosh.com/contact-us/). They will investigate your case more closely. But do not forget to send them messageid of delayed message(you can find it on notifications page)
It seems to depend on speed, sometimes a PHP call directly to APNS comes up right away other times it can take upto 15 seconds sometimes longer i would put this down to communication link with the handset and Apple Servers.
We are currently using a Drupal module for sending push notifications and they're delivered almost instantly. (2-5 secs). I don't know which one, but if you're interested I'll ask my colleague...