adjust-icon

Send push tokens

Push notifications enable you to deliver personalized content to your users. You can use deep links to direct users to specific pages in your app, and measure reattributions.

How it works

Each device generates a unique push token that's used to target it. The push token is sent to Adjust when the following information is passed to the MobileCore.track API:

  1. ADJAdobeAdjustActionSetPushToken: a string constant that maps to the setPushToken method.
  2. data: a dictionary of values used to configure your push token.

When you call MobileCore.track with these arguments, the Adjust extension the token to the setPushToken method and sends the information to Adjust.

Reference

The data dictionary holds information about an action. To configure your push token, add the following key-value pair to your dictionary.

ADJAdobeAdjustPushToken

The device's push token.

Example: Send a push token

To send a push token to Adjust, you need to add a function to your main activity. In this tutorial, you'll build on your ViewController from the integration guide and send an updated push token to Adjust. The final result looks like this:

Here's what you need to do:

  1. Inside your viewDidLoad function block, create a new dictionary called dataDict. This is used to hold the properties of the action.

  2. Add your push token to the dictionary using the ADJAdobeAdjustPushToken key. This example sets the push token to "de18dbf8-f38a-4962-8f1e-44abcf43055d".

  3. Finally, call MobileCore.trackAction with ADJAdobeAdjustActionSetPushToken and your dataDict dictionary to send the push token to Adjust. If you're using Objective-C, call removeAllObjects on your dataDict dictionary to deallocate it.

That's it! Your push token is sent to Adjust when the view loads.