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:

Setting the PingOne application ID in your app

To associate your application you created in PingOne with your iOS app:

  1. Retrieve your application ID from PingOne.

    a. Sign on to the PingOne for Customers admin console.

    b. Go to Connections --> Applications --> --> Profile.

    c. Copy the CLIENT ID value (a UUID similar to 2087a363-f1d5-43f1-8111-8ef0a5efed21).

  2. 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>

Initializing IdvService

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.

Initializing IdvService using the 12-digit code

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
        }
    }

Initializing IdvService using the QR code URL

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
        }
    }

Initialize IdvService using a retained configuration

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.

Enabling push notifications in your development environment

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
        }
    }

(Optional) Registering a NotificationHandler

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
        }
    }