How to test Push Notification is working in my application

102,772

Solution 1

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.

Solution 2

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

Solution 3

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

enter image description here

Solution 4

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.

Solution 5

You should try the the branch of PushMeBaby, it worked for me.

Share:
102,772

Related videos on Youtube

Naved
Author by

Naved

I have been working in IT industry since 2000. In my 20 years of experience, I have worked on Java, C#, C++, Android, Objective-C and VB. Currently, I am working as a Project Manager/Branch Manager in Unikaihatsu Software Pvt. Ltd. (Head Office in Mumbai, India and Branch Office in Indore). I am currently working on Java, Struts, IPhone (Objective-C) and Android technology.

Updated on July 09, 2022

Comments

  • Naved
    Naved almost 2 years

    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?

  • Naved
    Naved almost 13 years
    I am running PushMeBaby application, but it does not load the certificate causing not to send any push notification. I have added that certificate as guided in the tutorial, but still it is not working. any idea? Is the certificate for sandbox or production?
  • Nekto
    Nekto almost 13 years
    As is said in tutorial - you should use for sandbox and input your device token in PushMyBaby.
  • Naved
    Naved almost 13 years
    I did it so. I have added the certificate in resources using "Copy items into destination group folders" too. but still it is not working
  • Naved
    Naved almost 13 years
    Solved: Mine certificate name was "aps_developer_identity-1.cer" and not "aps.developer.identity-1.cer". Thank you for your support.
  • Oleg Trakhman
    Oleg Trakhman about 10 years
    +1 Worked for me too; Original PushMeBaby didn't send pushes from accepted answer
  • Viral Narshana
    Viral Narshana over 7 years
  • shim
    shim over 6 years
    Note this appears to be a more recently updated version.
  • Dhruv Sangvikar
    Dhruv Sangvikar almost 6 years
    The only problem with NWPusher is that it will not support HTTP/2
  • Augusto Gonzalez
    Augusto Gonzalez over 5 years
    This should be marked as the right answer. The app is soo cool. I was afraid I had to use node-apn, so I have to spend one day more debugging.
  • double-beep
    double-beep over 5 years
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.
  • phil
    phil over 5 years
    very straightforward for simple testing
  • Amarjeet Singh Rai
    Amarjeet Singh Rai about 5 years
    Thank you! Very simple to do
  • jeet.chanchawat
    jeet.chanchawat about 5 years
    link to "PushMeBaby Mac Os App" is dead