Skip to content

Handle Push Notifications

Kristiyan Petrov edited this page Sep 24, 2019 · 11 revisions

We highly recommend to add push notification to your app in oder to receive incoming calls even when the app is killed.

Be Aware

  • Notifications not shown if device enters Doze mode(Android 6.0+) for more info
  • In China FCM does not work (you can use Pushy, Baidu or similar services)
  • Chinese mobile phones(Huawei, Xiaomi, Oppo, Vivo, LeTV, IQOO, Asus, ...) have security settings that need to be handled by the end-user. You should show a dialog to tell the user that the application will need autoBoot, notifications shown, shown on lock-screen and power optimizations. This settings may not be required if your app is already in the white-list of the PlayStore and Chinese producers.

Server side steps required:

  • Listen server-side for webhook coming from Bandyer.

(Discover how your backend can be notified with upcoming call events registering event hook on_call_incoming here: https://docs.bandyer.com/Bandyer-RESTAPI/#webhooks).

  • Forward the data you have received via the webhook to your Android Application with a push notification framework of your choice (FCM, OneSignal or others)

Learn more about FCM
Learn more about OneSignal

Client side steps required:

  • Implement your client listener for notifications (FCM, OneSignal or any others) depends on the notification framework you have decided to use.
  • Once received the notification you will need to give the payload of the notification to our SDK. In case your application handles different types of notifications be sure to forward only the payload meant for our SDK (the one you have received from the webhook)

Client handle Payload

Incoming calls push payloads can be passed to the BandyerSDKClient object as shown below.

BandyerSDKClient.getInstance().handleNotification(getApplicationContext(), pushPayload);
Clone this wiki locally