To simplify your application logic and integration with the Knot Flutter SDK, Version 1.0 includes a number of breaking changes that may affect the way your integration works or behaves.
The new version includes a number of significant improvements:
Configuring and opening the Knot SDK has changed significantly in Flutter Version 1.0 and requires some refactoring in order to initialize the SDK with a session. Events and Errors now provide additional values to debug with.
Changes
.openCardOnFileSwitcher
is replaced with a more flexible .open
.Product
enum values .card_switcher | .transaction_link
.open
action now requires a KnotConfiguration
which is now Knot.open(knotConfiguration)
.Before
After
Changes
onEvent
type now provides the environment and product the event originanted from.KnotError
type provides improved error descriptions and product type.KnotSuccess
type now provides a product type and a metaData map.Before
After
Event Names
The SDK now maps raw event names to standardized event names for easier handling.
Event Name Prior to 1.0 | 1.0 Event Name |
---|---|
refresh session request | REFRESH_SESSION_REQUEST |
merchant clicked | MERCHANT_CLICKED |
login started | LOGIN_STARTED |
authenticated | AUTHENTICATED |
otp required | OTP_REQUIRED |
security questions required | SECURITY_QUESTIONS_REQUIRED |
approval required | APPROVAL_REQUIRED |
Error handling has been improved with more structured and meaningful error messages.
Changes
KnotError
enum.errorDescription
) and a unique error code (errorCode
).Before
After
Error Types
The Knot SDK provides predefined error cases for you to handle based on your own needs.
Error Case | Description |
---|---|
.invalidSession | The session is invalid. |
.expiredSession | The session has expired. |
.invalidClientId | The client ID is invalid. |
.internalError | An internal error occurred. |
.merchantIdNotFound | The merchant ID is required when product type = transaction_link. |
Most apps do not use the explicit close
method, as it is infrequently applicable to the integration with the Knot SDK.
Changes
_knotapiFlutterPlugin.close()
as opposed to _knotapiFlutterPlugin.closeKnotSDK()
.Before
After