This repository was archived by the owner on Apr 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Native Push
Mohamad Nour Chawich edited this page Jul 12, 2016
·
15 revisions
Wiki ▸ API Reference ▸ Notifications ▸ Native Push
Mobile clients should set Push tokens (APNS / GCM) for all users including guests.
- After each successful login / signup (including guest login). Simply after a successful
/oauth2/access_token - After each app open after being completely closed (foreground to background is not included)
Setting Push token will make sure it is transferred from the old owner (if exists) to the new one.
- Before logout, which is just before clearing oAuth2 tokens
If this call fails for any reason i.e timed out or got bad response, ignore that and continue the logging out process
##Push Events
| event name | when | data |
|---|---|---|
new_notification |
got new notification | {"app_url": "shoutit://url"} |
new_message |
got new message | {"app_url": "shoutit://url"} |
incoming_video_call |
receiving incoming video call | {caller Profile object} |
{
"event_name": "event name",
"title": "Example title to display on the notification (android)",
"body": "Example body to display on the notification (android, iOS)",
"icon": "Example image to display on the notification (android)",
"data": {},
"pushed_for": ""
}- Clients should display the
title,bodyandicon(when applicable). API tries to set these attributes for both Android and iOS - Clients should open the corresponding screen on
new_notificationandnew_messageusingdata.app_url- when there is no
app_urlor when it isnullsimply open the app on main screen
- when there is no
-
pushed_forhas the id of the profile that the API intended to notify. This is useful when page admins receive Push about their pages. Check Pages Notifications for more details about this case.