Import the subscriptions to web push notifications
The following steps describe how to migrate to Pushpad from another web push notification service.
The migration works for all standard browsers and push services. However not everything is standard out there: see Issues.
Import your sender and install Pushpad
First of all you need to get your VAPID key pair from your previous push service. The key pair is associated to your subscriptions and you cannot use your existing subscriptions without the key pair.
Then go to the Pushpad dashboard to create a new sender: when you are creating the sender, make sure to click Advanced options and enter your VAPID private key and VAPID public key. You must enter your keys in PEM format: if your keys use plain base64 encoding you need to convert them.
Once you have created your sender you can follow the normal instructions to install Pushpad on your website.
Import subscriptions
Usually you don't need to import subscriptions. You can just call pushpad('subscribe')
on your pages using the Javascript SDK and your existing subscribers will be imported to Pushpad as soon as they visit your website. The users that have already accepted to receive push notifications from your website won't see any prompt: their subscription will be imported automatically. This method has some advantages: it's simple and you avoid to import invalid or outdated subscriptions.
However if you want to import your subscribers you can use the REST API to create the subscriptions.
Issues
I don't have a VAPID key pair
Although VAPID is the current standard, some push services may use legacy and proprietary technologies, like the FCM API key. Other push services may use shared key pairs for multiple customers, which is bad. In those cases you don't have your VAPID key pair.
If you can't get your VAPID key pair don't worry: you can still install Pushpad from scratch. New subscriptions will work without any problems while your existing subscribers will need to restore their subscription in order to continue to receive your notifications. For example you can display an announcement on your website or send them an email to explain how to resubscribe to your notifications.
I already have the VAPID keys, but in a different format
You just need to convert your existing VAPID keys to the correct format, which is PEM in the case of Pushpad. If you use an open source library or another push service probably your keys use base64: you can easily convert from base64 to PEM and then import your PEM when you create the sender on Pushpad.
I have imported the subscriptions, but notifications are not delivered
If you choose to import your subscribers using the REST API, the notifications may take some time to start working. That happens because there is some code installed in the user browsers (i.e. Service Workers) that needs to be updated: this update should take at most 24 hours, based on the standard. However we have noticed that some browsers update the service worker only when the user visits your website again.
Subscriptions are associated to a domain that I do not own
You can only import subscriptions that are associated to your own domain. If your subscriptions are associated to a domain like my-website.my-push-service.com
, then you cannot move them to Pushpad. However you can still install Pushpad from scratch.
A subscription does not work
Please read all the above issues for specific tips. If a subscription still doesn't work you can usually fix it by resetting the browser permission.