Upgrading to Cordova SDK v3

Step 1. Find the current plugin variables values

Plugin variables can reside at multiple locations:

  • In your packages.json file, under the cordova.plugins.wonderpush-cordova-sdk field
  • In your config.xml file, under the <plugin name="wonderpush-cordova-sdk" [...]> tag
  • In the plugins/fetch.json file, under the wonderpush-cordova-sdk field

Take note of them, especially your SENDER_ID, you'll need them in the next step.

If need be, you can always find your Client ID and Client Secret from the Platforms tab of the Settings page:

1718

Step 2. Upgrading the SDK version

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
cordova plugin add wonderpush-cordova-sdk-fcm --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 value from the previous step.

Step 3. Remove calls to deprecated methods

Remove any calls to WonderPush.isReady().
You do not need to wait to use WonderPush.

👍

You're done!