Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test Push Notification is working in my application

In my application I am implementing the Push Notification Service.
I have a Content Provider server, which contains some products in it.
I have generated the SSL Client Certificate and attached it to my development Provisioning profile. This profile is also added to my application.
I have written the code inside the delegate methods (guided by Apple guideline for implementing the Push Notification). All set.

Now I want to test my application whether it is handing the push notification as per the requirement. Any idea on how can I test it would help me a lot.
Should I have to add new product to the content provider server to test this?

If yes, how much will APNS take to send the push notification to my device?

like image 746
Naved Avatar asked Sep 09 '11 11:09

Naved


4 Answers

I tried all 3 of the above suggestions with no success. In case someone else is ends up here looking for a solution to this, I found this and it works great:

Pusher https://github.com/noodlewerk/NWPusher

like image 126
LunaCodeGirl Avatar answered Oct 17 '22 19:10

LunaCodeGirl


Very cool guide is posted here: Programming Apple Push Notification Services

And an application named PushMeBaby Mac Os App which you can download and use for sending push-notifications to your devices from a Mac.

APNS will send the push notification to your device as soon as your device will become available. If I've not mistaken your device pings APNS every minute.

like image 24
Nekto Avatar answered Oct 17 '22 17:10

Nekto


What about curl:

curl -d '{"aps":{"alert":"This is a test notification"}}' --cert YourCertificate.pem:YourPassword -H "apns-topic: com.example.yourapp" --http2  https://api.development.push.apple.com/3/device/YourDeviceToken

First you need curl with http2 support.
And you need to convert your push certificate to pem format using openssl.

like image 14
erkanyildiz Avatar answered Oct 17 '22 19:10

erkanyildiz


If you want to support both Certificate and Token based authentication with APNS, then you can try Push Notifications

enter image description here

like image 14
onmyway133 Avatar answered Oct 17 '22 17:10

onmyway133