Initializing IdvService
creates an IdvService
object containing the user ID information. This object is then used in subsequent requests and messages sent to the ID Verification service. See the flow diagram in Flows for more information.
You’ll need to:
Set the PingOne application ID in your app.
Initialize IdvService using the 12-digit code, the QR code, or a retained configuration.
Set the uniqueToken
.
To associate your application you created in PingOne with your iOS app:
Retrieve your application ID from PingOne.
a. Sign on to the PingOne for Customers admin console.
b. Go to Connections --> Applications -->
c. Copy the CLIENT ID
value (a UUID similar to 2087a363-f1d5-43f1-8111-8ef0a5efed21).
Add the following keypair to your app’s info.plist
file to supply the application ID for the registered app in PingOne:
<key>p1v_app_id</key>
<string><your-client-id></string>
When ID verification is enabled for a user, the user initially will be presented with a 12-digit code and the URL for a QR code. You can initialize an IdvService
object using either of these.
If ID verification has previously been successful for the user, the user’s ID information and transaction ID will still exist in secure storage on their device. In this case, you can use the retained configuration to initialize IdvService
.
For example:
IdvService.Builder.initWithNewConfig(for: 12_DIGIT_CODE)
.setPushNotificationToken(PN_TOKEN)
.create { (result) in
switch result {
case .success(let idvService):
//Use IDVService
case .failure(let error):
//Handle IDVService initialization errors here
}
}
For example:
IdvService.Builder.initWithNewConfigFromQr(for: QR_URL)
.setPushNotificationToken(PN_TOKEN)
.create { (result) in
switch result {
case .success(let idvService):
//Use IDVService
case .failure(let error):
//Handle IDVService initialization errors here
}
}
For example:
IdvService.Builder.initWithSavedConfig()
.setPushNotificationToken(PN_TOKEN)
.create { (result) in
switch result {
case .success(let idvService):
//Use IDVService
case .failure(let error):
//Handle IDVService initialization errors here
}
}
See the IdvService.Builder or IdvService classes for more information.
To enable push notifications in the development environment, add coding similar to:
IdvService.Builder.initWithNewConfig(for: 12_DIGIT_CODE)
.setPushNotificationToken(PN_TOKEN)
.setPushSandbox(true) // Default value is false
.create { (result) in
switch result {
case .success(let idvService):
//Use IDVService
case .failure(let error):
//Handle IDVService initialization errors here
}
}
To handle a verification result or any errors while processing notifications, you can register a NotificationHandler in IdvService.Builder. For example:
IdvService.Builder.initWithNewConfig(for: 12_DIGIT_CODE)
.setPushNotificationToken(PN_TOKEN)
.setNotificationHandler(YOUR_NOTIFICATION_HANDLER)
.create { (result) in
switch result {
case .success(let idvService):
//Use IDVService
case .failure(let error):
//Handle IDVService initialization errors here
}
}