简体   繁体   中英

How to get incoming call notification when app is terminated from background

I am working on a VoIP app. I used PushKit in my app for getting notification. When my app is in background any incoming call notify the app and user can easily receive the call.

Now my problem is When I terminate the app from background there is no incoming call notification that is PushKit not working when the app is terminated from background. I came to know that PushKit not works when the app is terminated from background. is it right? If so then how can I do the work when app is terminated from background and incoming call will notify the app.

While your app is in terminated mode then you have to make Pushkit payload like this.

$body['aps'] = array(
'content-available'=> 1,
'alert' => $message,
'sound' => 'default',
'badge' => 0,
);

On basis of payload you have to schedule interactive "Accept" and "Decline" button interactive local notification.

https://github.com/hasyapanchasara/PushKit_SilentPushNotification

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM