Push Notifications
Push Notifications provide a way to deliver some information to users while they are not using your app actively. The following use cases can be covered additionally with push notifications:
- send a chat message when a recipient is offline (a push notification will be initiated automatically in this case)
- make a video call with offline opponents (need to send a push notification manually)
Configuration
In order to start work with push notifications you need to configure it.
For iOS application that uses Apple Push Notifications you must have APNS certificate uploaded via the ConnectyCube Dashboard Console panel.
For Android application that uses Firebase Cloud Messaging (FCM) you need to obtain API Key and set it on ConnectyCube Dashboard Console panel.
Subscribe
In order to start receiving push notifications you need to subscribe your current device as follows:
Response example from ConnectyCube.pushnotifications.subscriptions.create(params)
- see
Send push notifications
You can manually initiate a push notification to user/users on any event in your application. To do so you need to form a push notification parameters (payload) and set the push recipients:
Response example from ConnectyCube.pushnotifications.events.create(pushParameters)
- see
Receive push notifications
The flow how you receive push notifications depends on what platform you use: NativeScript, React Native or something else. Please refer to the push notifications documentation of these platforms.
Unsubscribe
In order to unsubscribe and stop receiving push notifications you need to list your current subscriptions and then choose those to be deleted:
Response example from ConnectyCube.pushnotifications.subscriptions.list()
- see
VoIP push notifications
ConnectyCube supports iOS VoIP push notifications via same API described above:
- for VoIP pushes it requires to generate a separated VoIP device token.
- then when token is retrieved, you need to subscribe to voip pushes by passing a
notification_channel: apns_voip
channel in a subscription request - then when you want to send a voip push notification, use
ios_voip: 1
parameter in a push payload in a create event request.