0
votes

I created a simple chat application that sends push notifications to the receiver when he's offline.

As I said in the title, when the app is killed I can't deliver the message correctly via a push notifications. Actually, when the iPhone recevives the push notification and the app is killed, even application:didReceiveRemoteNotification:fetchCompletionHandler is not triggered (as found in the other examples and apple documentation).

However, my app doesn't do any different from whatsapp, but still if I send a push notification via whatsapp even when it is killed the receiver will get his message delivered correctly.

How is this even possible

I read about PushKit and its VOIP push notification mode, but i want to understand if Whatsapp really use this functionality and, if I would use it, will my app risk to be rejected from Apple?

Thanks in advance.

UPDATE:

The test that i did with whatsapp is the following:

  1. Whatsapp on iPhone killed;
  2. Another device send me a message on Whatsapp;
  3. My iPhone receives the Push Notification;
  4. Activate airplane mode on iPhone;
  5. Open Whatsapp with icon app (not with tap on push notification);

Result: The message is correctly there. That makes me think that there is no sort of synchronization when Whatsapp starts but the message data is already delivered on the iPhone.

How is this possible if I can't react to a Push Notification if my app is forced killed?

1
maybe, because it fetches the new messages when it becomes active again...?holex
Objective-c or swift. You are using both tags. Refine your tags.Sushil Sharma
@SushilSharma SwiftSimone Fusco
@holex I've added some test details in my UPDATE.Simone Fusco

1 Answers

0
votes

@BjørnRuthberg Solved it with VOIP Notification.