iOS SDK
Installation
Add package LinkSDK in your project’s Package Dependencies or download LinkSDK.xcframework.
Get Link token
Link token should be obtained from the POST /api/v1/linktoken endpoint
. API reference for this request is available here. The request must be performed from the server side because it requires the client’s secret. You will get the response in the following format:
Set up GetFrontLinkSDK
with the linkToken
Launch Link
Create a LinkConfiguration
instance with the linkToken
and the callbacks:
The callback onIntegrationConnected
is called with LinkPayload
once an integration has been connected.
The callback onTransferFinished
callback is called once a crypto transfer has been executed or failed. The parameter is either success(TransferFinishedSuccessPayload)
or error(TransferFinishedErrorPayload)
.
The callback onEvent
is called to provide more details on the user’s progress while interacting with the Link. This is a list of possible event types, some of them may have additional parameters:
loaded
integrationConnectionError
integrationSelected
credentialsEntered
transferStarted
transferPreviewed
transferPreviewError
transferExecutionError
The callback onExit
is called once a user exits the Link flow. It might be used to dismiss the Link view controller in case the app manages its life cycle (see LinkHandler.create()
)
Callback closures are optional, but either onIntegrationConnected
or onTransferFinished
must be provided.
Create a LinkHandler
instance by calling createHandler()
function, or handle an error. The following errors can be returned:
- Invalid
linkToken
- Either
onIntegrationConnected
oronTransferFinished
callback must be provided
In case of success, you can call LinkHandler.present
(in viewController
) function to let LinkSDK
modally present the Link view controller and dismiss it on exit, or get the reference to a view controller by calling LinkHandler.create()
if you prefer your app to manage its life cycle.
Adding URL Schemes to Info.plist
To enable our SDK to interact with specific apps, please add the following URL schemes to your info plist file
- Open your info.plist located in the ‘ios’ directory of your React Native project
- Add the following XML snippet within the
<dict></dict>
tag.