If you are migrating from another push provider (or from your existing homegrown solution), you can import a list of existing push tokens into Sailthru Mobile. This can allow you to send push notifications to these devices and temporarily import other device properties (such as User IDs and attributes) so you can target these devices until they upgrade to Sailthru Mobile.

This is a managed process and it is handled by Sailthru. To get started, you will need to provide a file in the format and with the requirements highlighted in this page. If you want more general information, read Migrating to Sailthru Mobile.

File Format

Tokens must be passed as a CSV list (one token per line). The first row is a header record containing column (field) names. Only the alphanumeric part of the token must be passed; extra characters (such as :, -, _ token separators) must be stripped out of the token value. For each token you must also specify the target platform.

We only support custom attribute fields that are registered against the user. For consistency purposes, attributes such as locale, country, timezone, etc, cannot be uploaded, as these default attributes are generated directly from the mobile app via the Sailthru Mobile SDK.

Each line in the import file should represent a user's device. Only scalar values are allowed (one value per attribute).

Field name

Required

Description

token

Yes

The push token issued by APNS or FCM. Only ASCII characters are allowed.

os_name

Yes

The platform name. Use either iOS or Android (case sensitive).

user_id

No

The ID of the user, if available. Can be any value.

custom.<DATA_TYPE>.<ATTRIBUTE_NAME>

No

Custom user attributes you wish to import along with the token. Valid data type values are:

  • integer
  • float
  • string
  • date
  • boolean

For example, if you store the customer's life time value as an integer, your field name could be named custom.integer.life_time_value.

📘

Duplicate tokens will be ignored during the import. If you have multiple User IDs belonging to the same tokens, only the first valid entry will be imported.

Data items

  • The number of items in each row should match the number of columns defined in the header row.
  • All columns should be separated by a , character.
  • Strings which include a " character, should have the character escaped with "" (double quotations)
  • If you do not want to set an attribute for a device, pass through an empty string between the commas using ,,.

Data types

Sailthru Mobile will make a best effort to parse the value into the specified data format. Only scalar values are allowed for custom attributes (one value per attribute).

Data type

Ranges/valid values

Example

Notes

integer

-2,147,483,647 to 2,147,483,647

12, 24, 25

Floating point numbers are accepted but they will be truncated to an integer. If you wish to keep the decimal part, use float instead.

float

12.343, 123.33

string

UTF-8 character encoding

Cody, gold, A string with a , comma

In a CSV, wrap , in quotation marks, and " in double quotation marks.

date

ISO 8601, e.g. YYYY-MM-ddTHH:mm:ssZ

2017-02-06T18:25:32+0300

boolean

true or false

The import process

The import process is structured to ensure Sailthru Mobile only import quality data.

  1. We will check the import file to verify it has the correct format required to proceed. If the data is valid, we will import it into a test app.
  2. You will need to verify the data and notify Sailthru Mobile that the import can proceed. If you need to add additional data, you will need to update the import file. We will then proceed with a new upload to a new test app.
  3. Once you're satisfied with the data, we will then import the data into your production app.

Next Steps

It is important to remember that as the app update is installed, and the user starts to use the app, the anonymous user will be replaced by the real user.

This means that their attributes will be removed. To address this, make sure you set the current values of the user attributes on the first launch of the updated app.