Class Veery

registerNotification(_ subscriptionType : String, _ notificationFormat : String)

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
subscriptionType 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 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

    {
        "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)"

    }

Returns

Void

Usage / Example

    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)

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.