Step 1: Render the Axle Enode component
This is a helper component, which will automatically generate and return correctly scoped Enode tokens. The end user will see a loading indicator, and you’ll need to listen to messages to correctly show the Native Enode SDK.Example component view
Step 2: Listen for the Enode token from the component
You’ll need to listen for the Enode token once the component has authenticated and fetched from Axle. The Enode component automatically sends this token usingWKWebView
message handlers on iOS.
We’ll first register the message handlers in the WebView. This example is using SwiftUI,
but it’s also easy to do this in UIKit by implementing the WKScriptMessageHandler
delegate.
Register message handler in the WebView
Adding a JS listener
Step 3: Handle the Enode token and trigger LinkSDK
Once you receive the Enode token from the Axle component, you’ll need to present the LinkSDK to complete the asset connection. First, import LinkKit and add the necessary state variables.Import LinkKit and add state variables
Handle token and trigger LinkSDK
Add LinkKit sheet
Handle LinkSDK results