0

If you use Facebook Messenger on iOS and start a video chat with someone, the recipient will receive a push notification that stays on screen while the call is ringing. Then if the initiator who started the call hangs up before the recipient answers and the notification is on the screen, the notification is "canceled" and the sound stops, and then another notification pops up and says you have a missed call.

Does anyone know how this is implemented? How are they canceling a push notification that has already been pushed to the recipient?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Drew S.
  • 516
  • 4
  • 19
  • It probably isn't a push notification. It is a local notification. The app is a VoIP app, so it is receiving call status updates over a network connection or via PushKit. When there is an incoming call, it posts a local notification to alert that there is an incoming call. If the call is cancelled it cancels that local notification and posts a new missed-call notification. – Paulw11 Sep 13 '16 at 23:16
  • So even if the app is closed, it can still execute code in the appthat will display a local notification? Because I've tested this when I have both the FB app and Messenger app closed and forced them closed from the tray. If that is the case, how can this be replicated in other apps? – Drew S. Sep 13 '16 at 23:29
  • Silent push notifications are received by an app when it is suspended but not when it is terminated. PushKit notifications are received by the app even when it is terminated. – Paulw11 Sep 13 '16 at 23:39

0 Answers0