registerApplication

Creates the registration for this application and starts the connection. This method is equivalent to calling registerApplication:0.

If an application identifier has not already been set, a SUPPersistanceException is thrown. If connection properties are not available, a SUPConnectionPropertyException is thrown. If you use this method, do not call startConnection.

Syntax

- (void)registerApplication;

Parameters

None.

Examples

Usage

You must set up the ConnectionProperties and ApplicationIdentifier before you can invoke registerApplication.

The maximum length of the Application ID is 64 characters. The total length of the Application Connection ID cannot exceeds 128 characters. The Application Connection ID format is deviceId__applicationId. The applicationId separator is two underscores.

SUPApplication* app = [SUPApplication getInstance];
[app setApplicationIdentifier:@"SMP101"];

MyApplicationCallbackHandler *ch = [MyApplicationCallbackHandler getInstance]; 
[app setApplicationCallback:ch];
SUPConnectionProperties* props = app.connectionProperties;
[props setServerName:@"server.mycompany.com"];
[props setPortNumber:5001];

SUPLoginCredentials* login = [SUPLoginCredentials getInstance];
login.username = @"supAdmin";
login.password = @"supPwd";
props.loginCredentials = login;
[app registerApplication]; // method returns immediately