App registration (v.2.1.x - 2.2.x)
It’s possible to register a customer’s application on a remote server using the methods provided by the SDK.
For the registration functionality to work, the SDK must be supplied with a configuration file containing the “service_id” field. See SDK configuration file generation for details.
The following functionality is supported:
Setting application details via the
-(void)setAppDetailsWithCustomerAppName:customerAppVersion:otherInfo:
method, including:Application name
Application version
Additional information about the app
Setting user details via the
-(void)setUserDetailsWithAccountId:details:
method, including:Name
Email
Mobile phone number
Additional information about the customer
Setting vehicle details via the
-(void)setVehicleDetailsWithAccountId:details:
method, including:Vehicle Identification Number (VIN)
Serial number
Part number
RTO number (for India)
Additional information about the vehicle
The registration process consists of the following steps:
Obtaining an API key using an account authentication token
Setting the application details
Setting the user details or the vehicle details
When the SDK has all the data needed for registration, it will automatically submit a request to the registration server, retrying in case of errors.
It’s possible to add a listener to be notified about the registration process via the-(void)addAppRegistrationListener:
method (or remove it using the -(void)removeAppRegistrationListener:
method).
Example:
[NMSdk obtainApiKeyWithAccountAuthenticationToken:token completion:^(NSString * _Nullable apiKey, NSString * _Nullable newApiToken, NSError * _Nullable error) {
[pathwayProSDK startWithSettings:configurationSettings completion:^(NSError * _Nullable error) {
[pathwayProSDK setAppDetailsWithCustomerAppName:@"customerApp"
customerAppVersion:@"v1.2.3"
otherInfo:@"customer app additional information"];
NMVehicleDetails *vehicleDetails = [[NMVehicleDetails alloc] initWithVin:@"vin12345"
serialNumber:@"sn12345"
rtoNumber:@"rto12345"
partNumber:@"part12345"
otherInfo:@"otherInfo123456"];
[pathwayProSDK setVehicleDetailsWithAccountId:@"account_id"
details:vehicleDetails];
}];
}];
});