Importing historical push tokens
Leanplum automatically captures the push tokens of your existing users the first time they open the app version that is live with the Leanplum SDK.
However, you may want to start sending push notifications to existing users before they come back to the app, especially to re-engage lapsed users or reach users who have yet to upgrade to the latest version.
To reach these existing users, you can upload any pre-existing iOS push tokens or Android GCM registration IDs using Leanplum’s REST API, specifically the setDeviceAttributes API call.
You’ll need the following data to upload your users' push tokens:
- Device ID
- iOS Push token or GCM registration ID
- User ID (Optional but highly recommended if you will be setting your own user ID)
You must use the same format of device ID with the Leanplum SDK and your historical token data. Learn more about which device ID format to use .
Prepare your csv file
First, prepare your CSV with your device attributes
|userId||String||YES (if you set User IDs in Leanplum)||The user id. It must be the first column of the CSV file.|
|deviceId||String||YES||The device id. A single user may have multiple device ids.|
|iosPushToken||String||NO||Use this to set the iOS push token of the device. Push tokens are device specific, so in the CSV file, you must specify which deviceId this token belongs to. This is done by having the device ID and the push token on the same row.|
|systemName||String||No||The value should be either iOS or Android OS. This must match the push token type you are uploading.|
|gcmRegistrationId||String||NO||Use this to set the Android push token of the device. Push tokens are device specific, so in the CSV file you must specify which deviceId this token belongs to. This is done by having the deviceId and the push token on the same row.|
Copy your API keys
Updated almost 2 years ago