radkrish
radkrish

Reputation: 177

How whatsapp handle APNS notifications even if the app was not launched?

So I am trying to handle the APNS notification even if the app was not launched in iOS,Same like in whatsapp...But ended with failure...Can anyone explain how i can archive this ?

Upvotes: 0

Views: 643

Answers (3)

garg
garg

Reputation: 2727

PushKit can be send to send notification for VOIP app which will silently launch app even if it is terminated by user.

Upvotes: 1

Hasya
Hasya

Reputation: 9898

When you download app from app store and don't launch then you cant have push notification.

Try this

  • Keep distribution certificates
  • Edit scheme
  • Select "Wait for executable to be launched"
  • Now run app in device
  • Keep debug pointer on didFinishLaunchingWithOptions

Your app will install on device, send push notification it will not come ( Because app not registered for APNS, device token did not reached to server ).

Now tap on app debug pointer at didFinishLaunchingWithOptions will become active, let appDelegate to do rest of work, now send push notification it will come ( Because app is now registered for APNS, device token also reached to server ).

Using pushkit is different thing, would not help you to get push notification without launching an app.

Upvotes: 0

San9211
San9211

Reputation: 191

You can use PushKit (VoIP notification) to achieve this. App should be launched once after that regardless of state of the app notification will appear on device. For this type of notification, app will not ask user confirmation about sending notifications.

Upvotes: 0

Related Questions