Migration from 2.0.x to 3.0.x

PowerAuth Mobile Flutter SDK version 3.0.0 uses PowerAuth Mobile SDK version 2.1 on Android and iOS. This version contains the following changes:

  • The minimum supported iOS version is now iOS 15.0, because Xcode 27 does not support older versions.
  • PowerAuthPassword has new methods that work with Unicode code points. The methods that accept a character are deprecated.
  • The activation status contains the time when a temporarily blocked activation will be unblocked.

This version does not change the PowerAuth protocol or the PowerAuth configuration, so existing activations need no upgrade step. The only required change is the iOS deployment target. The deprecated PowerAuthPassword methods still work, but they will be removed in the next major version.

Compatibility with PowerAuth Server

  • Protocol 4.0 requires PowerAuth Server version 2.0.0 or later.
  • Legacy protocol 3.3 requires PowerAuth Server version 1.9.0 or later.
  • The block expiration time of an activation requires PowerAuth Server version 2.2.0 or later.

Platform Requirements

  • Flutter 3.44.0 or later and Dart 3.12.0 or later. This requirement did not change.
  • Android 6.0 (API 23) or later with Java 17 compatibility enabled. This requirement did not change.
  • iOS 15.0 or later. Version 2.0.x required iOS 13.4.

iOS Deployment Target

The plugin and the native PowerAuth Mobile SDK 2.1 require iOS 15.0. If your application has a lower deployment target, raise it when you update the plugin. Users with iOS 13 or iOS 14 cannot install an application version that contains this SDK.

Open ios/Runner.xcworkspace in Xcode. Select the Runner target and set Minimum Deployments to iOS 15.0 or newer. Then regenerate the iOS configuration:

flutter build ios --config-only

If your project uses Swift Package Manager, no other change is required. Flutter resolves the native PowerAuth2 dependency in version 2.1.x during the next build.

If your project uses CocoaPods, also set the platform version in ios/Podfile:

platform :ios, '15.0'

Then install pods:

cd ios
pod install
cd ..

ios/Podfile.lock from the previous version contains PowerAuth2 in version 2.0.x. If pod install reports that it could not find compatible versions for the PowerAuth2 pod, run pod update PowerAuth2 in the ios directory.

Android

No change is required on Android. Gradle resolves the native PowerAuth Mobile SDK in version 2.1.x automatically.

Secure Password

PowerAuthPassword stores the password as a sequence of Unicode code points. The methods that accept or remove a “character” are deprecated and have replacements that work with code points:

Deprecated API Replacement
addCharacter(String) addCodePoint(int) or addCodePoints(String)
insertCharacter(String, int) insertCodePoint(int, int)
removeCharacterAt(int) removeCodePointAt(int)
removeLastCharacter() removeLastCodePoint()

removeCodePointAt() and removeLastCodePoint() work the same as the methods they replace. addCodePoints() is new. It appends every code point of a string, the same as PowerAuthPassword.fromString() does.

// Version 2.0.x
await password.addCharacter('1');
await password.removeLastCharacter();

// Version 3.0.x
await password.addCodePoint(0x31);      // '1'
await password.removeLastCodePoint();

To append the text of one key of a custom keyboard, use addCodePoints():

final length = await password.addCodePoints(key);

addCodePoints() adds the code points one by one, so it is not atomic. If it fails, the password may contain only some of them.

addCharacter() and insertCharacter() store only the first code point of a string. This behavior is the same as in version 2.0.x. A character such as '👍🏽' or 'é' consists of more than one code point, so these methods do not store it completely.

If your application passed such characters to these methods, then a password that the user already set contains only the first code point of each character. This password does not match when you add every code point with addCodePoints(). Every failed attempt counts toward the maximum failure count of the activation.

To keep accepting such passwords, add only the first code point with addCodePoint(character.runes.first). You can also let the user change the password. Pass the old password with only the first code points to beginPasswordChange() and the new password with all code points to finishPasswordChange().

If your application passes only characters with one code point, such as the digits of a PIN, then the replacement methods store the same password as before.

See Working with passwords securely for the complete description.

Activation Status

PowerAuthActivationStatus.blockExpirationTime is a new optional property. If the activation is temporarily blocked, it contains the time when the activation will be unblocked, in milliseconds since the Unix epoch. Otherwise, the value is null. Compare the value with the synchronized time, not with the local time of the device:

final status = await powerAuth.fetchActivationStatus();
final blockExpirationTime = status.blockExpirationTime;

if (status.state == PowerAuthActivationState.blocked && blockExpirationTime != null) {
    final now = await powerAuth.timeSynchronizationService.currentTime();
    final remaining = Duration(milliseconds: blockExpirationTime - now);
    print("Activation will be unblocked in ${remaining.inSeconds} seconds");
}

The value is always null with PowerAuth Server older than version 2.2.0 and with the legacy protocol 3.3.

Last updated on Dec 03, 2026 (14:35) Edit on Github Send Feedback

develop

PowerAuth Mobile Flutter