8

Till now after searching what i know is, in iOS , notifications cannot be handled, once the app is killed , and after that app is launched by tapping app icon.

i want to achieve what whatsapp does, i.e.

1) i kill whatsapp from multitasking swipe up. 2) i receive whatsapp 1 new message push notification. 3) then without launching whatsapp(through app icon or through notification) i disconnect mobile data/ wifi or any internet connection. 4) after disconnecting all connections, i launch whatsapp BY LAUNCHING IT FROM APP ICON(and not from notification). 5) then i find that those notification message is already shown at the top chat as the new message with message count.

Now, my concern is, how does whats app handle push notification, even after app is killed.

  • 1
    there is a special kind of notification for voip, when receiving it, app will be launched in background even user killed it manually. The rest (handling notification data) is done as usual. – nsinvocation Mar 29 '16 at 08:05
  • @azimov : could you please explain it a bit more and share some documentation links? – Ujjwal Khatri Mar 29 '16 at 08:13
  • 1
    Apple's documentation: https://developer.apple.com/library/ios/documentation/Performance/Conceptual/EnergyGuide-iOS/OptimizeVoIP.html – Vinod Vishwanath Mar 29 '16 at 08:15
  • I think sir @azimov is trying to suggest a feature called `Silent push notification` which enables your app to receive notifications in the background. Even if your app is not running, whenever a notification is sent, the system will wake up your app and will be on the background for receiving the notification. – Scar Mar 29 '16 at 08:17
  • @ujjwal, search for push kit . – Shridhar Sawant Mar 29 '16 at 10:51
  • @scar, silent push notification as per apple documentation doesn't work when user kills app (by swipe up). – Shridhar Sawant Mar 29 '16 at 10:55
  • 1
    @azimov, u are right they use push kit, but does apple allow use of push kit for non voip use i.e. push notification like whats app in the scenario i mentioned where there is no voip related – Shridhar Sawant Mar 29 '16 at 11:02
  • Whatsapp is a VoIP app (to receive VoIP Push Notifications app must enable VoIP mode). As far as I know other type of notifications can't wake up app is if was killed by user. – nsinvocation Mar 29 '16 at 13:10
  • @ShridharSawant can you find any solution i m facing same issue – kirti Chavda Feb 23 '17 at 14:13
  • @kirtimali , you can you background fetch method for remote notification. which wakes your app and lets you process data in background. But still it will not help you when your app is killed. Only apple pushkit allows you to wake app even when your app is killed. (eg. skype and watsapp use this feature which have voip in their app.) – Shridhar Sawant Feb 27 '17 at 06:12
  • @ShridharSawant thank you for reply.what did whatsup when it had no voip functionality i telling about older version whatsup – kirti Chavda Feb 27 '17 at 08:40
  • @kirtimali, right, however i did not needed this functionality before whatsapp had voip. thus i did not check how whatsapp worked before that. btw what functionality are you trying to implement – Shridhar Sawant Feb 28 '17 at 07:32
  • @ShridharSawant we are trying that functionality when notification arrived while user mobile and wifi is off also user clear notification from notification center then user open app want that notification message – kirti Chavda Feb 28 '17 at 07:39
  • what's app has voip but is it not compulsory to report voip notifications on UI ?? and app gets banned for further notifications if its not reported? can we use VoIP notifications just to wake up the app and sync data in the background? – Sanaullah Irfan Nov 16 '20 at 14:01
  • @SanaullahIrfan, You need to have VOIP feature in app for apple to approve your app for using VOIP framework. – Shridhar Sawant Mar 05 '21 at 07:20

1 Answers1

5

PushKit is the only solution...

For ref:- https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/PushKit_Framework/

vje1998
  • 691
  • 6
  • 19