Migration from 3.0.x to 4.0.x
This guide covers changes between 3.0.x and 4.0.x. Version 4.0.x moves to PowerAuth Mobile JS SDK 5.0.0 and PowerAuth Networking JS SDK 2.0.0.
Breaking Changes
- Update the PowerAuth plugins.
The plugin requires PowerAuth Mobile JS SDK 5.0.0 or newer and PowerAuth Networking JS SDK 2.0.0 or newer. Compatible versions are installed automatically when missing. If older cordova-powerauth-mobile-sdk or cordova-powerauth-networking plugins are installed, update or remove them before adding this plugin. See the PowerAuth Mobile JS SDK 5.0 migration guide for changes in PowerAuth itself.
- Raise the iOS deployment target of your Cordova app to
15.0or newer.
<platform name="ios">
<preference name="deployment-target" value="15.0" />
</platform>
- Create a reusable
PowerAuthPasswordwith the options object.
When calling finishActivation with validatePassword set to true, the password must not be destroyed on use. PowerAuth Mobile JS SDK 5.0.0 takes an options object instead of a boolean.
Before:
const password = await PowerAuthPassword.fromString(pin, false)
After:
const password = await PowerAuthPassword.fromString(pin, { destroyOnUse: false })
- Handle the updated activation status in
WDOVerificationServiceListener.
The status passed to powerAuthActivationStatusChanged can now be UNKNOWN and is never CREATED.
- Use request interceptors when calling
WPNNetworkingdirectly.
If your app uses WPNNetworking from PowerAuth Networking JS SDK, the requestProcessor argument of call() was removed. Pass requestInterceptors in WPNConfig to the WPNNetworking constructor instead. Interceptors synchronously receive and return a WPNRequest, including its url, and apply to every request made by that instance.
Checklist
- Update or remove older
cordova-powerauth-mobile-sdkandcordova-powerauth-networkingplugins before adding this plugin. - Set the iOS
deployment-targetpreference in your app’sconfig.xmlto15.0or newer. - Replace
PowerAuthPassword.fromString(pin, false)andnew PowerAuthPassword(false)with the{ destroyOnUse: false }options object. - Handle
UNKNOWNand stop expectingCREATEDinpowerAuthActivationStatusChanged. - Move
WPNNetworkingrequest processing toWPNConfig.requestInterceptors.