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.
- The push token is a unique identifier that can be used to sort Audiences and client callbacks.
- Push tokens are also required for uninstall and reinstall measurement.
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:
ADJAdobeAdjustActionSetPushToken
: a string constant that maps to thesetPushToken
method.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:
Inside your
viewDidLoad
function block, create a new dictionary calleddataDict
. This is used to hold the properties of the action.Add your push token to the dictionary using the
ADJAdobeAdjustPushToken
key. This example sets the push token to"de18dbf8-f38a-4962-8f1e-44abcf43055d"
.Finally, call
MobileCore.trackAction
withADJAdobeAdjustActionSetPushToken
and yourdataDict
dictionary to send the push token to Adjust. If you're using Objective-C, callremoveAllObjects
on yourdataDict
dictionary to deallocate it.
That's it! Your push token is sent to Adjust when the view loads.