Upgrading to Cordova SDK v2

Step 1. Find your Firebase Sender Id

Use the following guide to find your Firebase Sender ID.
It is likely that you are using our own Sender Id as default.
Take note of it, you'll need it in the next step.

Step 2. Upgrading the SDK version

Take note of your Client ID and Client Secret from the Platforms tab of the Settings page:

1718

Run these commands:

cordova plugin rm wonderpush-cordova-sdk --variable CLIENT_ID= --variable CLIENT_SECRET=

cordova plugin add wonderpush-cordova-sdk --variable CLIENT_ID=YOUR_CLIENT_ID --variable CLIENT_SECRET=YOUR_CLIENT_SECRET --variable SENDER_ID=YOUR_SENDER_ID

Replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with the appropriate values you find in the Platforms tab of the Settings page, in the Android application or iOS application section.
Replace YOUR_SENDER_ID with the from the previous step.

Step 3. iOS rich notifications

Look at the output of the cordova plugin add command to see if it tells you that it could not automatically add the Notification Service Extension for iOS.
If you see it, then remove your Notification Service Extension in XCode, and re-add the plugin.

Test to ensure that you are still able to receive rich notifications.

Step 4. Rename a few methods

Whenever you see cordova.plugins.WonderPush, or plugins.WonderPush, replace it with WonderPush.

Deprecated methodNew method
getInstallationCustomProperties()getProperties()
putInstallationCustomProperties()putProperties()
getNotificationEnabled()isSubscribedToNotifications()
`setNotificationEnabled(true)subscribeToNotifications()
setNotificationEnabled(false)unsubscribeFromNotifications()

You're done!