7min

iOS App Integration

Integration

CocoaPods is a dependency manager for Cocoa projects. To integrate the Keyri iOS SDK into your Xcode project using CocoaPods, specify it in your Podfile:

Ruby
|

The SDK can then be imported into any Swift file as follows:

Swift
|

Set Up User Login

Please refer to iOS for detailed instructions about how to set up the SDK to handle Authentication via URL Deep linking and/or a built in Scanner

Provision and retrieve API login credentials from the APEX WebSocket API (GetAPICredentials())

Keyri's session object has a "payload" field in which you can input any data, which will be encrypted all the way to the browser when the user scans the login QR code and the valid session is confirmed. You can fetch the user's API credentials from the APEX user management system at any point before this, and populate this field with the API credentials before going on to confirm the session. Please see sample code below

Important Note: The APIKey and APISecret will be decommissioned as soon as the user is logged in on the browser.

This function can be activated once the login QR code has been scanned and parsed, either from a Universal Link (iOS) / App Link (Android) or your app's built-in QR code scanner.

Construct the function as follows:

1.Send the following message to wss://apexapi.{yourDomain}/WSGateway with the user's UserId:

JSON - Request
|

2. In return, you will receive an APIKey and APISecret as follows:

JSON - Response
|

3. Finally, the function must return values for APIKey, APISecret, and UserId. These three items will subsequently be passed into the Keyri initializeQrSession() method. Please see the iOS App Integration page for details on how this function is invoked

This example uses Native iOS functions to handle websockets

Swift
|









Updated 08 Jun 2022
Did this page help?
Yes
No