To simplify your application logic and integration with the Knot iOS 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 iOS Version 1.0 and requires some refactoring in order to initialize the SDK with a session. Errors are now encapsulated in a KnotError
object which provides an enumerated value to debug with.
Changes
Knot.createCardSwitcherSession
and Knot.createTransactionsLinkSession
are replaced with a more flexible KnotConfiguration
.useCategories
, useSearch
, and merchantIds
.open
action now requires a KnotConfiguration
and an optional KnotEventDelegate
which is now Knot.open(configuration:delegate:)
.Before
After
Changes
KnotEventDelegate
instead of closures.onSuccess
, onError
, and onExit
are now explicit methods inside a delegate.onEvent
method introduces the KnotEvent
object to better handle Knot emitted events.KnotError
type provides improved error descriptions.sendCard
parameter is deprecated and its functionality incorporated into the metaData
dictionary within KnotEvent
when KnotEvent.event
equals AUTHENTICATED
.Before
After
SendCard
Most apps do not use the explicit sendCard
method, as it is rarely applicable to the integration with the Knot SDK.
The sendCard
parameter has been deprecated and its functionality is incorporated into the metaData
dictionary within KnotEvent
when the KnotEvent.event
equals AUTHENTICATED
. This change enhances flexibility by allowing additional contextual data to be included in events without requiring separate parameters. Previously, sendCard
was accessed as a standalone value, but now developers can retrieve it from the metaData
dictionary in the event callback. This approach ensures better extensibility and consistency across different event types. To access the sendCard
value, simply extract it from the event’s metaData
dictionary.
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. |
Most apps do not use the explicit close
method, as it is infrequently applicable to the integration with the Knot SDK.
Changes
Knot.close()
as opposed to being bound to the session object.Before
After