Dynamic client registration
To initialize user registration, the device must be registered. This is done via device registration. As an app developer, there is no need to initialize device registration because it is automatically triggered by the iOS SDK. If any errors occur during this process, they are reported back to the app via the delegates that you pass to the iOS SDK methods. For device registration, the app needs to identify itself to the IDAAS-core. This is done by sending the identifier, version, and platform of the app. Furthermore, the app needs to provide proof of its identity to the IDAAS-core. A common reason why device registration would fail is if the application version is not properly configured in the IDAAS-core. The iOS SDK does not provide the app with an error other than a general device registration error, since it is not able to distinguish what error did occur. The result of successful Dynamic Client Registration is the client ID and client-specific key pair. The iOS SDK stores them securely on the device in the keychain (client ID) or secure enclave (key pair). Of those two, you can only retrieve the clientId
. It is done using the SharedDeviceClient.instance.clientIdError
method.
NSError *dataAccessError = nil;
NSString *clientId = [[ONGDeviceClient sharedInstance] clientIdWithError:&dataAccessError];
if (dataAccessError) {
// handle data access error
}
let error = SharedDeviceClient.instance.clientIdError