Module Veery
registerNotification(subscription, format)
Request for a Push notification to be sent to the user when a specified geo-predictive event occurs.
Parameters
Param name | Type | Usage and Possible values |
---|---|---|
subscription | String | Name of the subscription to a notification (push) feed |
Veery.NOTIF_HELLO : The subscription "hello" is for testing purpose. The Veery Backend will send your Notification every minute | ||
Veery.NOTIF_ROUTEMATCH : When subscribed to "routematch" the Veery Backend will send your Notification on each new trip computation | ||
Veery.NOTIF_POI : When subscribed to "poi" the Veery Backend will send your Notification when a new poi list is generated | ||
Veery.NOTIF_PREDICTION : When subscribed to "prediction" the Veery Backend will send your Notification when a trip prediction is generated | ||
"MyTailoredMatching" : Any string will be accepted as a subscription name, by you should contact the Roofstreet team to create the matchings required | ||
format | String | Envelope defining the message that will be visible by your user. The format is described in the FCM documentation / APNs documentation. |
Usage of Tags in your format
By using the %tagname% format you can specify your message variables as known by Veery backend at the time of the notification.
Example of format
IOS Platform
{ "aps" : { "alert" : { "title" : "This will be the visible title of the notification", "body" : "This will be visible body, and can contain references to any %tagname% " } }, "your_custom_data_key1" : "This will be invisible (readable in your didReceiveRemoteNotification)" }
Android Platform
{ "data" : { "your_custom_data_key1" : "This will be invisible (readable in your FirebaseMessagingService Interface)" }, "notification" : { "title" : "This will be the visible title of the notification", "body" : "This will be visible body, and can contain references to any %tagname% " } }
Do not hesitate to use the "hello" subscription to test your own format in your dev environment.
Returns
Void
Usage / Example
if (Platform.OS === 'ios' ) { let notificationHello = "{\"aps\" : {\"alert\" : { \"title\" : \"Veery Hello\",\"body\" : \"Vous avez demandé une notification Hello chaque minute. En général c'est juste pour tester\"},\"sound\": \"chime.caf\", \"badge\": 0},\"your_custom_data_key1\" : \"your_custom_data_value1\"}"; Veery.registerNotification(Veery.NOTIF_HELLO,notificationHello); }else{//Android let notificationHello = "{\"data\": {\"your_custom_data_key1\": \"your_custom_data_value1\"},\"notification\": { \"title\": \"VEERY Hello\",\"body\": \"Vous avez demandé une notification Hello chaque minute. En général c'est juste pour tester\"}}"; Veery.registerNotification(Veery.NOTIF_HELLO, notificationHello); }
User interaction
A notification will be sent out-app.
The notification is not showed by the user when it currently interacts with your app.
See also
registerNotification
Enable a notification for a specified geo-predictive event.
unregisterNotification
Disable notifications for a specified geo-predictive event.