iOS SDK Integration
Choose your mobile platform to view the native SDK integration guide.
Use the native iOS SDK when you want to host the embedded Ria experience inside a WKWebView. Complete the Framework Setup first so you understand the SSO token lifecycle, and apply the iOS App Configuration settings for permissions and WebView configuration.
Step 1: Add the Swift package
Section titled “Step 1: Add the Swift package”You will be given a ZIP file that you can then add to your project by following the steps below:
- In Xcode: File → Add Package Dependencies…
- Then click on Add Local and select the package to add it
If you manage dependencies in Package.swift, add:
dependencies: [ .package(url: "https://github.com/p-haddad_euronet/digital-sso-sdkios.git", branch: "main")],targets: [ .target( name: "YourApp", dependencies: [ .product(name: "WebViewWrapper", package: "digital-sso-sdkios") ])]Step 2: Initialize the WebView
Section titled “Step 2: Initialize the WebView”Add a WKWebView through the wrapper, provide user data to prefill registration, and reuse a stored SSO token to auto-login returning users.
import SwiftUIimport WebKitimport WebViewWrapper
struct MoneyTransferWebView: UIViewRepresentable, TokenDelegate { @Binding var isLoggedIn: Bool private let wrapper = WebViewWrapper()
func makeUIView(context: Context) -> WKWebView { wrapper.delegate = self wrapper.setPackageName(Bundle.main.bundleIdentifier ?? "") // optional theming hook
// Prefill user data (all fields optional) let payload = UserInfo() payload.email = "user@email.com" payload.phoneNumberCountry = "1" payload.phoneNumber = "5551234567"
wrapper.initializeWebViewWrapper( payload: payload, // pass nil for a simple flow ssoToken: loadSavedToken() // reuse token to auto-login ) return wrapper.getView() }
func updateUIView(_ uiView: WKWebView, context: Context) {}
// Receive and persist new tokens func onTokenRecieved(_ token: String) { saveToken(token) isLoggedIn = true }
func clearSession() { wrapper.clearToken() UserDefaults.standard.removeObject(forKey: "ria_sso_token") isLoggedIn = false }
private func saveToken(_ token: String) { UserDefaults.standard.set(token, forKey: "ria_sso_token") // replace with Keychain in production }
private func loadSavedToken() -> String? { UserDefaults.standard.string(forKey: "ria_sso_token") }}WebView Key Components
Section titled “WebView Key Components”| Component | Description |
|---|---|
UserInfo | Fields are optional; provide what you have (email/phone recommended) |
TokenDelegate.onTokenRecieved | Fires when a new token is issued; store it securely and pass it back via ssoToken next time |
| Session Management | To log out, clear your own session and call clearSession() (which calls clearToken() on the wrapper) |
WebView Public API surface
Section titled “WebView Public API surface”| Method/Property | Description |
|---|---|
WebViewWrapper() | Create an instance of the wrapper |
delegate: TokenDelegate? | Set delegate to receive tokens |
initializeWebViewWrapper(payload:ssoToken:) | Start the embedded experience (both parameters optional) |
setPackageName(_:) | Set the package/bundle name used for theming |
getView() -> WKWebView | Get the WebView to embed in your UI |
clearToken() | Wipe the token held by the wrapper |