Skip to main content

Documentation Index

Fetch the complete documentation index at: https://help.getvero.com/llms.txt

Use this file to discover all available pages before exploring further.

This guide is for developers integrating Vero with your mobile application. It covers identifying device tokens against user profiles and tracking push opens from iOS and Android. For configuring your push provider in Vero, see Push channel.

Definitions

  • Push notification — A notification sent to an iOS or Android device using Apple or Google’s inbuilt notification infrastructure. This is different to “web push” or SMS.
  • Push delivery provider — The service that manages your certificates with Apple and Google and sends push messages to those platforms. Vero sits “on top of” your push delivery provider.

Before you start

This guide assumes you have already:
  1. Configured a push channel in Vero — Added an Amazon SNS or Twilio Notify provider on the Channels page.
  2. Configured your delivery provider’s integration with Apple and/or Google — APNs certificates for iOS, FCM credentials for Android.
  3. Configured your iOS or Android application to register devices and receive a device_token from Apple or Google.
Each delivery provider has its own documentation for the steps above. For Twilio, we recommend:

Identify device tokens with Vero

To send a push message to a user, Vero needs a device_token on the user’s profile. Generally, your mobile client passes the device token to your application backend, which registers it with your delivery provider. At that same point, your backend should also send the token to Vero.
Register device tokens from your server backend rather than the mobile client. This avoids exposing your Vero API credentials in the application bundle.
To add a device token, make a request to Vero’s API using the identify method, including a channels array. The type field should always be push, and platform should be either ios or android.
curl \
  --header "Content-Type: application/json" \
  --request POST \
  --data '{
    "auth_token": "YOUR_AUTH_TOKEN",
    "id": "test@getvero.com",
    "channels": [{"type": "push", "address": "UNIQUE_DEVICE_TOKEN", "platform": "ios"}],
    "data": {"first_name": "John", "last_name": "Doe"}
  }' \
  https://api.getvero.com/api/v2/users/track
Every time the device token changes and you register it with your delivery provider, send the updated token to Vero too. The platform field only accepts ios or android.
See the API reference for full details on the identify endpoint.

Tracking push opens with Vero

When a user receives a push notification from Vero, your application’s notification handler can call back to Vero to record the open event. Vero includes a message_data property in the notification payload — your handler should extract this and POST it to Vero’s acknowledge endpoint.

iOS example

// Called when a push message is received
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
  // Vero push notifications include a "message_data" field which
  // can be used to send feedback on interaction.

  if let messageDataValue = userInfo["message_data"] {
    let messageData = String(describing: messageDataValue)

    let parameters: Parameters = [
      "auth_token": "YOUR VERO AUTH TOKEN",
      "message_data": messageData
    ]

    Alamofire.request(
      "https://api.getvero.com/api/v2/notifications/acknowledge", method: .post, parameters: parameters
    )
  }
}

Android example

/**
 * Called when a push message is received.
 *
 * @param message The remote message, containing from, and message data as key/value pairs.
 */
@Override
public void onMessageReceived(RemoteMessage message) {
  Map<String,String> data = message.getData();
  String messageData = data.get("message_data");

  if (messageData != null) {
    try {
      URL url = new URL("https://api.getvero.com/api/v2/notifications/acknowledge");
      HttpURLConnection connection = (HttpURLConnection) url.openConnection();
      connection.setRequestMethod("POST");
      connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
      connection.setRequestProperty("Accept", "application/json");
      connection.setDoOutput(true);
      connection.setDoInput(true);

      JSONObject jsonParam = new JSONObject();
      jsonParam.put("auth_token", VERO_AUTH_TOKEN);
      jsonParam.put("message_data", messageData);

      DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream());
      outputStream.writeBytes(jsonParam.toString());

      outputStream.flush();
      outputStream.close();

      connection.disconnect();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}
These are simple reference examples. Adapt them to fit your application’s networking and error-handling patterns.

Testing your integration

Once your application is sending device tokens to Vero, the easiest way to test the full flow is:
  1. Install your app on your own device and trigger the registration flow to send your device token to Vero.
  2. Search for your profile in Vero and confirm the device token is present.
  3. Create a test push campaign targeting the same platform as your device token.
  4. Send a test push to your profile and confirm it arrives on your device.
Make sure the platform selected on your test campaign matches the platform of the device token on your profile. If you send to iOS but only have an Android token, the message won’t be delivered.

Going live

Once you’ve completed an end-to-end test, you’re ready to start sending push campaigns to your full user base. Make sure device tokens are being added and updated for all of your users so they’re eligible to receive push messages.

Next steps

  • Push channel — configure or manage your Amazon SNS or Twilio Notify provider.
  • Push content — write your push message content using the basic or advanced editor.
  • Push journey node — send push as part of an automated Journey.

Need Help?

If you have any questions, reach out to us at support@getvero.com.