Skip to main content

Migrating push subscriptions from third-party services

Step 1. Get VAPID keys from the service from which you're going to migrate

Request the keys from the technical support of your service. Both private and public keys are required: private key, public key.

tip

VAPID keys and Application Server keys are the same thing.

Step 2. Import the VAPID keys into your Firebase project

Go to project settings in Firebase and go to the Cloud Messaging tab. At the bottom of the page, you will see the Web Configuration section. Here you can generate keys yourself, but we do not need this, since you have already received VAPID keys from your service. Click "import an existing key pair" at the very bottom of the section.

In the new window enter Public key and Private key that you've got from the technical support of your service.

Step 3. Configure the resource

For information on configuring a resource for Web push notifications, see Web push: setting and implementation.

tip

Please note that resource settings differ from browser to browser.

Step 4. Create a csv file with subscriptions

When a new user subscribes to push notifications, a PushSubscription object is created. It contains all the information that is necessary to send push notifications to this user. The object is stored in JSON format:

Example of PushSubscription
{
"endpoint": "https://some.pushservice.com/something-unique",
"keys": {
"p256dh": "BIPUL12DLfytvTajnryr2PRdAgXS3HGKiLqndGcJGabyhHheJYlNGCeXl1dn18gSJ1WAkAPIxr4gK0_dQds4yiI=",
"auth": "FPssNDTKnInHVndSTdbKFw=="
}
}

Now we need to unload the subscription fields (i.e. the key values of the PushSubscription object) from a third-party service. In other words, you need to get a csv file in any way available for the service. In this file each subscription should have the values of the following fields: endpoint, p256dh, auth.

Step 5. Provide the csv file with these fields to the administrator or Altcraft support service

If the Altcraft platform is deployed inside your business (On-Premise solution), transfer the generated csv file with subscriptions to the platform administrator.

If the platform is installed on the cloud (SaaS solution), transfer the csv file to Altcraft support.

Step 6. Take the processed csv file from the administrator

Step 7. Import profiles

Now you can import profiles into Profile Database from a csv file. During the import a subscription to the required provider will be created.

In addition, you have the opportunity to update the database by creating a subscription to the same provider. Please note that in this case it must be one of the Firebase providers.

tip

The provider identifier allows you to find out which browser the subscription belongs to and through which service it was created. Examples of providers: Chrome Firebase, Apple Safari, Mozilla Firefox.

So, create or select a database and click Import customer profiles in the drop-down list.

Select the import method - File. Upload the required csv file with subscriptions.

Click Profiles matching mode and select By push subscription in the drop-down list.

caution

If your csv file contains any data that can be used to configure correspondences between profiles ("match users"), then before the import process, select the appropriate profile search mode.

Click the "Add subscription" button and then configure the subscription:

  1. Channel is Push channel;

  2. Provider — if the subscription browser is unknown, you can import subscriptions with the Chrome Firebase provider;

  3. Contact data source — firebase_push_token.

caution

To create a subscription, you need the name of the field where the id of the subscription you are importing is stored. In our csv file, this field will be called firebase_push_token.

Now it's time to configure column mapping:

  • SubscriptionIDfirebase_push_token

  • Provider — Altcraft provider id field

tip

If the Altcraft provider identifier field is missing in the csv file, then specify the same field as in the SubscriptionID. This way you'll create a new subscriber for each subscription.

caution

In the Skip Lines field, enter "1" if the file contains headers. Otherwise, the headers will be captured on import.

After you click the Import button in the upper right corner of the screen, the process of importing new profiles into the Database will begin.

Once the profiles have been successfully imported, you can check them in the selected Profiles Database. Open the Subscriptions tab to see the new profile subscription for push notifications and information about it.

tip

If you would like to migrate from OneSignal, see this article: Migration from OneSignal.