iOS
Add the PayMedia eKYC SDK to your iOS app and start a journey.
Install
The SDK is published from a private PayMedia repository; your PayMedia contact gives your team read access. Add it with Swift Package Manager or CocoaPods.
Swift Package Manager: in Xcode choose File › Add Package Dependencies, enter the address below, and choose Up to Next Major Version from 1.0.0. Add the `PayMediaEKYC` library to your app target.
https://github.com/PayMediaSL/saas-revamp-ekyc-runtimepod 'PayMediaEKYC', :git => 'https://github.com/PayMediaSL/saas-revamp-ekyc-runtime.git', :tag => '1.0.0'Camera and microphone
iOS asks the customer for the camera and microphone in your app's words. Add both descriptions to your `Info.plist`; without them iOS stops the app the first time a journey asks.
<key>NSCameraUsageDescription</key>
<string>To photograph your identity document and verify it is you.</string>
<key>NSMicrophoneUsageDescription</key>
<string>To talk to our agent on your video verification call.</string>Configure
import PayMediaEKYC
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
try? PayMediaEKYC.configure(PayMediaConfig(
journeyHost: "https://onboarding.bank.example",
sdkKey: Secrets.payMediaSdkKey
))
return true
}Start a journey
PayMediaEKYC.startJourney(
from: self,
workFlowId: "3f2c9a1e-0000-4000-8000-000000000000",
delegate: self
)
extension OnboardingViewController: PayMediaDelegate {
func payMedia(didEmit event: PayMediaEvent) {
if event.kind == .journeySubmitted {
showConfirmation(reference: event.data["reference"])
}
}
func payMedia(didFailWith error: PayMediaError) {
switch error {
case .versionUnsupported(let webJourneyURL): askToUpdate(webJourneyURL)
case .network: showRetry()
default: log(error.code)
}
}
func payMediaDidClose() {
returnToHome()
}
}The delegate is held weakly, so keep a reference to it for as long as the journey is open — a view controller that presented the journey already does.
Join a video call
PayMediaEKYC.joinVideoCall(from: self, joinURL: joinURL, delegate: self)Sign-out
When the customer signs out of your app, call `PayMediaEKYC.terminate()`. A journey never writes to disk on iOS, so this only forgets the configuration and push token; configure again before the next journey.