-
Notifications
You must be signed in to change notification settings - Fork 0
Pages Notifications
Wiki ▸ API Reference ▸ Notifications ▸ Pages Notifications
Pages can receive notifications just like normal users. The notifications will be sent either directly to the page such as Pusher events or to the page admins in the case of Push.
Push tokens are tied to Users not Pages. Pages receive Push through their admins. Therefore clients must set the push tokens for the admin not the page. Push notifications have a property pushed_for which is the id of the intended profile who should receive the push. In the case of a logged in user as one of his pages and Push received, clients must check pushed_for to decide whether to follow app_link or not.
Clients should
- follow
app_linkifpushed_forhas the same value of the (actual) logged in profile (page or user) - ignore
app_linkotherwise and just open the app on home screen
When logged in as a page clients must subscribe to both page's and admin's presence channels. This makes sure all real-time events will be received for both the admin and the page. It also prevents the admin from receiving unnecessary Push while using Shoutit as his page.
Events on the page presence channel should be treated just like those when a user is logged in. All events except stats_update on the admin presence channel should be ignored. This is useful to show the total_unread_count next to the page / admin switch button to inform the admin about his personal notifications.
When logged in as a page clients must subscribe to Twilio as the page not the admin. This makes it easier for calling clients to retrieve single video client id (page video client) and call it. All page admins should get the incoming video call. If no admins are online at the time of the call, API sends Push to each admin where they can open the app and once subscribed to Twilio as their page they should be able to receive video calls on its behalf. Same works regarding missed call Push.
The cases where admins get personal video calls when they are logged in as their pages (or the opposite where admins get page video calls while they are logged to their personal profile) are not addressed now.