registerUser:password:error:isSyncFlag: method

Registers the client with the server by automatically creating a user with the help of a pre-defined authentication mechanism.

Syntax

- ( BOOL ) registerUser : ( NSString * ) userName password : ( NSString * ) loginPassword error : ( NSError ** ) error isSyncFlag : ( BOOL ) isSynchronous

Parameters

Returns

Returns a BOOL indicating if the user registration has been successful. Significant in case of synchronous registration only.

Example 1

Synchronous Registration 
SMPUserManager* userManager = [SMPUserManager initializeWithConnection:clientConn];
NSError* error = nil;
if([userManager registerUser:"username" password:@"password" error:&error isSyncFlag:YES])
{
    // Further processing
} else
{
    // Error handling using the error object defined above
}



Asynchronous Registration 
SMPUserManager* userManager = [SMPUserManager initializeWithConnection:clientConn];
NSError* error = nil;
[SMPUserManager setDelegate:self]; // The class implementing the listener methods should adhere to <SMPUserManagerDelegate> protocol
[userManager registerUser:"username" password:@"password" error:&error isSyncFlag:NO];