Setting Up Application Properties

The Application instance contains the information and authentication credentials needed to register and connect to the SAP Mobile Server.

The following code illustrates how to set up the minimum required fields:
// Initialize Application settings
SUPApplication* app = [SUPApplication getInstance];
        
// The identifier has to match the application ID deployed to the SAP Mobile Server
app.applicationIdentifier = @"SMP101";
                
// ConnectionProperties has the information needed to register
// and connect to SAP Mobile Server
SUPConnectionProperties* props = app.connectionProperties;
props.serverName = @"server.mycompany.com";
// if you are using Relay Server, then use the correct port number for the Relay Server.
// if connecting using http without a relay server, use the messaging administration port, by default 5001.
// if connecting using https without a relay server, then use a new port for https, for example 9001.
props.portNumber = 5001;

// if connecting using https, set the network protocol
props.NetworkProtocol = @"https"; 

props.activationCode = @"activationcode";
// if you are connecting through relay server, then use the MBS farmId for that Relay Server
// otherwise use the farmId from the SCC application connection
props.farmId = @"farmId";  
// if you are connecting through relay server and using auto registration,
// then you must provide the correct urlSuffix from the relay server
// Obtain the url suffix value from the Relay Server configuration for the specific farm.
// The client url suffix value should be used in the application.
// For example: props.urlSuffix = @"/ias_relay_server/client/rs_client.dll";      
props.urlSuffix = @"urlSuffix";   
        
// provide user credentials
SUPLoginCredentials* login = [SUPLoginCredentials getInstance];
login.username = @"supAdmin";
login.password = @"supPwd";   
props.loginCredentials = login;
        
// Initialize generated package database class with this Application instance
[SMP101SMP101DB setApplication:app];

If you are using a Relay Server, specify the connection as follows:

// specify Relay Server Host
Props.serverName = @"relayserver.mycompany.com";
// specify Relay Server Port (port 80 by default)
Props.portNumber = 80;
// specify the Relay Server MBS Farm, for example MBS_Farm
Props.farmId = @"MBS_FARM";

Optionally, you can specify the Relay Server URL suffix.

Related reference
Application APIs