PHP Technique to Query the Apns Feedback Server

PHP script for Apple Push Notification FEEDBACK service gets TIMEOUT every time,

Solved it.. Turns out I had the wrong port.
To clarify :

  1. port 2195 is for pushing messages
  2. port 2196 is for getting feedback

my bad..;) I mixed the two together and was connecting to the feedback server on port 2195 instead of 2196

How do I listen to the APN Feedback Server using the Zend Framework?

Apple is not calling your script. Your script calls Apple's Feedback Service periodically (for example, once every day - you decide how often to run the script). Then you process the device tokens returned by the Feedback Service and remove obsolete Device Tokens from your DB.

Query the feedback service daily to get the list of device tokens. Use
the timestamp to verify that the device tokens haven’t been
reregistered since the feedback entry was generated. For each device
that has not been reregistered, stop sending notifications. APNs
monitors providers for their diligence in checking the feedback
service and refraining from sending push notifications to nonexistent
applications on devices.

You can read more about the Feedback Service here.

How to find the Apple Push Notification Delivered to user or not from our server?

APNS does not tell you if a message is successfully delivered. The closest you can get is poll its Feedback Service to see if your app is uninstalled from a device. Check out this SO post for an idea how: PHP technique to query the APNs Feedback Server

What you can do is have your iOS app record something whenever a push notification arrives with application:didReceiveRemoteNotification but that only works if your app is running in the foreground.

PHP Apple Push Notifications feedback service

Well after sending Apple an email and waiting about 2 weeks, I finally got the following response from them:

Connecting to the feedback service uses the same TLS/SSL identity (certificate and private key) that you use to connect to the APNs gateway. APNs identifies which app you wish to communicate with from the UserID attribute of the certificate.

Therefore, just as you have to establish a separate connection to APNs for each app to send notifications, you have to do the same for the feedback service.

So you gave to make a separate connection for each app to the feedback service.

How to find the Apple Push Notification Delivered to user or not from our server?

APNS does not tell you if a message is successfully delivered. The closest you can get is poll its Feedback Service to see if your app is uninstalled from a device. Check out this SO post for an idea how: PHP technique to query the APNs Feedback Server

What you can do is have your iOS app record something whenever a push notification arrives with application:didReceiveRemoteNotification but that only works if your app is running in the foreground.

APNS - How to connect to feedback service

I've written a Python scrip that can send push notifications and checks for obsolete tokens.
You can find it here (shameless plug, but I think it is relevant here):

https://github.com/Joride/pushnotificationmakerandsender

Remember that Apple is updating its APNS service to a new protocol which makes it a lot easier to get what you are looking for. Check out the WWDC 2015 session on push notifications. There might already be some documentation for it too.



Related Topics



Leave a reply



Submit