Install CocoaPods
Create a Podfile
Add to your Podfile
Go to File, Add Packages
Enter Knot package URL
knot-api-ios
package.Decide on your Dependency Rule
Confirm package dependency
KnotConfiguration
class. The configuration allows you to set the environment, entry point, and other user experience configurations.
KnotConfiguration
and CustomerConfiguration
classes are used to initialize the SDK with specific parameters.
KnotConfiguration
Name | Type | Description |
---|---|---|
sessionId | String | The session created by calling /session/create in your backend. |
clientId | String | Your organization’s client ID. Note that this varies between development and production environments. |
environment | Environment | The desired environment (development or production ). |
product | Product | Optional. Ignored in version 1.0.11+ and fully deprecated in the next major version. The Knot product the session will inherit the same as the type of session created (e.g. card_switcher , transaction_link ). |
entryPoint | String? | Optional. The specific entry point from within your app where you are initializing the Knot SDK (e.g. onboarding ). |
useCategories | Bool | Optional. Whether to display merchant categories and therefore group merchants into categories for discoverability. Default: true . |
useSearch | Bool | Optional. Whether to display the search bar, enabling users to search for merchants. Default: true . |
merchantIds | [Int]? | Optional. A list of merchant ID(s) to display. It is recommended to provide 0 or 1 merchant ID depending on your desired user experience. |
CustomerConfiguration
onError
callback. To take advantage of this functionality, please contact the Knot team who will be happy to assist you.Name | Type | Description |
---|---|---|
cardName | String | Optional. The differentiated display name for the card product, used inside the Knot SDK (e.g. Debit Card , Credit Card ). This value will override the default value Card . |
customerName | String | Optional. The differentiated display name for the company, used both as a standalone and prepended to the cardName (e.g. Smart Bank , Payment Corp ). This value will override your default customer name value. Only recommended if you issue cards under multiple brands. |
logoId | String | Optional. The differentiated logo for the company. This value will override your default logo. |
"Your [customerName] [cardName | Card] was added."
open
method with a KnotConfiguration
instance and an optional KnotEventDelegate
.
KnotConfiguration
. More in Retrieving & Listing Merchants. The merchant ID is the same across all environments.
KnotConfiguration
. This value will be returned in the AUTHENTICATED
webhook.
useCategories: false
and useSearch: false
in KnotConfiguration
. This is not recommended.
KnotEventDelegate
in your class.
onSuccess
onError
KnotError
enum with 4 possible cases, as described below.
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. |
.invalidCardName | The card name is invalid. |
.invalidCustomerName | The customer name is invalid. |
.invalidLogoId | The logo ID is invalid. |
onExit
onEvent
KnotEvent
class as described below.
KnotEvent.event
property.
Name | Description |
---|---|
REFRESH_SESSION_REQUEST | Emitted when the session used to initialize the SDK needs to be refreshed. |
MERCHANT_CLICKED | Emitted when a user clicks on a merchant from the merchant list. |
LOGIN_STARTED | Emitted when a user submits their credentials to login to the merchant. |
AUTHENTICATED | Emitted when a user successfully logs in to the merchant. |
OTP_REQUIRED | Emitted when a user needs to enter an OTP code to login to the merchant. |
SECURITY_QUESTIONS_REQUIRED | Emitted when a user needs to enter answers to security questions to login to the merchant. |
APPROVAL_REQUIRED | Emitted when a user needs to approve the login - often via a push notification or directly in the merchant’s mobile app - to login to the merchant. |
ZIPCODE_REQUIRED | Emitted when a user needs to enter their zip code to login to the merchant. |
LICENSE_REQUIRED | Emitted when a user needs to enter their drivers license to login to the merchant. |