How Do I Migrate My Existing App Audience to Airship?

To migrate your app and current audience to Airship, you'll first need to work through the steps in our Quickstart Guide to download the Airship SDK, install it in your app, upload your certificate (for iOS), and send a test push for the platform of your choice.   

Once Airship's SDK has been successfully implemented in your app, you can start registering FCM or APNs tokens within Airship as Channels. To migrate your existing audience, you can either create a bridge in code which will serve to register users once they've opened your app OR import your entire audience at once via REST API. 

If you are unable to retrieve your current audiences APNs (iOS) or FCM (Android) tokens, you will be unable to import via REST API.  

 

Initial Airship Setup

Step 1: Create an Airship app.

The first step is to create an app in the Airship dashboard at go.airship.com

We recommend creating both a Live and Test app. Apple will treat these apps differently and will supply any devices registered through the development servers with a device token unique from the one they will receive in production. For further information on why we recommend a Live and Test app, see Production vs Development Apps in Airship. 

For your initial testing, it is important that you use a Test app.

See our Getting Started documentation for more help.

Step 2: Work through the Quickstart Guide to implement the Airship SDK in your app.

If you need further guidance on this process, see our documentation

Step 3: Set up the Push Services.

Set up your app's push service as needed via the Quickstart Guide:

Step 4: Send a Test Push

The final step of the Quickstart Guide is to send a message to test your setup. Once you've completed this step, you will see more options in the left menu and you'll now have complete access to your app. 

To create a production app, you'll need to repeat the process for creating the development app, this time switching to production/distribution when appropriate. You can do some last minute testing with your production app by provisioning test devices by creating an Ad Hoc provisioning profile. 

 

Migrate Device Tokens to Airship via App Code

Choose this option if you can run Airship in Parallel with an existing provider to gradually register users within Airship as they open your app. 

To migrate users in code, you'll need to register your existing app audience using the Airship SDK. This can happen gradually as your users open your app. To do this, you must first have forward new and existing tokens to Airship from your existing push service. 

 

iOS

Airship can run in tandem with other providers, but special steps will need to be taken to disable automatic integration and forward appropriate methods from userNotificationCenter and application.  

See this guide for more information. 

 

Android

Our SDK can run in tandem with existing push services if the onNewToken and onMessageReceived calls are forwarded via Airship's Firebase Integration. 

See this guide for more information. 

 

 

User Data

Existing data about your audience will also need to be forwarded to Airship's SDK.

 

See Airship's guides for Audience Segmentation for more information.  

 

Migrate Device Tokens to Airship via API

Choose this option if you are able to access FCM or APNs tokens from your existing implementation. 

Airship provides an API endpoint that will allow you to import your iOS and Android audience from your existing push implementation into Airship. 

If you import invalid iOS Device Tokens to your app, you may no longer be able to send push notifications using that Airship app. 

If you are unsure about importing your audience to Airship, contact support at https://support.airship.com. 

API Endpoint:

POST /api/channels/import/

Import a number of Device Tokens or FCM Registration IDs into Airship, creating a Channel for each device

This API will not allow more than 200 devices in a single request.

API Request:

This API endpoint uses the base url https://go.airship.com/. This request has a body, and the body must be in JSON format. When sending this request, set the Content-type header to application/json.

The body of the request must contain one device object, or an array of device objects that include:

  • A single push address (Device Token or FCM Registration Token)

  • Device Type (iOS or Android)

  • Opt-in status (True or False)

The body of the request may also include:

  • Tags or other attributes for segmentation

If you would like to segment your imported devices we recommend adding a tag when devices are imported. For example, adding an "imported_device" tag to your devices will allow you to target or exclude imported devices when sending messages.

Authentication:

This API request is identified using HTTP Basic Authentication. The username portion is the Airship app key. The password is your Airship master secret.

Versioning Syntax:

You must specify the version of the API you are using with the Accept HTTP header.

The default content type is JSON, while the latest version of the API is 3.

IOS

Validating your iOS devices:

Before you import your iOS audience, we recommend that you validate your iOS audience to ensure you can reach an active and engaged audience when the migration is complete.

In order to validate your iOS devices, send a push notification without an alert. The ideal method would be to use your current push provider to send a push notification with an empty alert field, or simply omit the alert from your payload.

The notification will reach the device, but will not display to the user.

Apple will provide feedback to you on the unreachable devices. These should then be removed from any import to Airship.

Importing your iOS devices:

Register your iOS device to Airship.

Example Request:

POST /api/channels/import/
HTTP/1.1 Authorization: Basic <master authorization string>
Accept: application/vnd.urbanairship+json; version=3;
Content-type: application/json  [
    {
        "device_type": "ios",
        "opt_in": true,
        "push_address": "<DEVICE TOKEN>"
    }
]

 

Android

Importing your Android devices:
Register your Android devices to Urban Airship.

You can import GCM and FCM Registration Tokens, but not the older GCM Registration IDs. For more information on how to differentiate the two, see the FAQ topic How do I know I'm importing correctly? in the FAQs section below.

Example Request:

POST /api/channels/import/
HTTP/1.1 Authorization: Basic <master authorization string>
Accept: application/vnd.urbanairship+json; version=3;
Content-type: application/json  [
    {
        "device_type": "android",
        "opt_in": true,
        "push_address": "<FCM REGISTRATION TOKEN>"
    }

 

FAQs

Will Integrating Airship's library interfere with other Push Notification services?

No. Integrating and registering your app users with Airship will not render these devices unable to receive notifications from the previous service you were using. Notifications are sent to devices by Apple or Google. Any push service you are using will be querying Apple or Google to send the data, which you've provided, to your users. 

How do I add additional attributes to my audience?

If you have additional attributes or tags from your current push provider that you would like to carry over, you can use Airship tags to ensure that information is carried across.

Example Request:

POST /api/channels/import/
HTTP/1.1 Authorization: Basic <master authorization string>
Accept: application/vnd.urbanairship+json; version=3;
Content-type: application/json  [
    {
        "device_type": "ios",
        "opt_in": true,
        "push_address": "<DEVICE TOKEN>",
        "set_tags": true,
        "tags": [
            "exampleTag1",
            "exampleTag2"
        ]
    }
]

 

Example Response:

HTTP/1.1 202 Accepted Content-Type: application/vnd.urbanairship+json; version=3;  { "ok": true }

 

How do I know I'm importing correctly?

If you import incorrect/invalid device identifiers to your app, you may no longer be able to send push notifications. If you are unsure about importing your audience to Airship, contact support at https://support.airship.com. 

When importing your Android audience, make sure you are working with FCM Registration Tokens.

 

Example Request with both iOS and Android:

POST /api/channels/import/
HTTP/1.1 Authorization: Basic <master authorization string>
Accept: application/vnd.urbanairship+json; version=3;
Content-type: application/json[
    {
        "device_type": "ios",
        "opt_in": true,
        "push_address": "<Device Token>"
    },
    {
        "device_type": "android",
        "opt_in": true,
        "push_address": "<GCM Registration Token>"
    }
]

Related Content: 

 

Was this article helpful?
2 out of 2 found this helpful
Submit a request