An iOS RBS client that connects through a Relay Server needs two different farm IDs: one for a messaging client connection to register the application, and the RBS connection for database synchronization.
In your iOS application, set up the messaging client and database connection through Relay Server. Note that, in most cases, the application template already contains settings for the RBS connection so you do not need to set any properties. The settings from the template are downloaded to the client after registration is completed. However, it may be necessary in a development environment to directly manipulate the settings.
SUPApplication * app = [SUPApplication getInstance]; // should be same as application id from SCC [app setApplicationIdentifier:@”appId”]; SUPConnectionProperties* props = app.connectionProperties; [props setServerName:serverName]; [props setPortNumber:80]; // or 443 for HTTPS [props setNetworkprotocol:@"http"]; // or https for secure connection [props setUrlSuffix:@""]; [props setFarmId:@"farmIDMBS"]; SUPLoginCredentials* login = [SUPLoginCredentials getInstance]; login.username = @"userName"; // same as in Application Connection login.password = nil; props.loginCredentials = login; props.activationCode = @"123"; // same as in Application Connection props.securityConfiguration = @"admin";
SUPConnectionProfile *sp = [SUP101SUP101DB getSynchronizationProfile]; [sp setUser:@"supAdmin"]; [sp setPassword:@"password"]; [sp setAsyncReplay:NO];
SUPConnectionProfile *sp = [SUP101SUP101DB getSynchronizationProfile]; [sp setUser:@"supAdmin"]; [sp setPassword:@"password"]; [sp setAsyncReplay:NO]; [sp setServerName:@"relayServerHostName"]; [sp setPortNumber:443]; // or 80 for http [sp setNetworkProtocol:@"https"]; // certificateName: this should come from the relay server and should be // included in the Resource folder of the XCode project [sp setNetworkStreamParams:@"trusted_certificates=certificateName;compression=zlib;url_suffix=urlSuffixRBS"];
The above code should be done before doing any data synchronization (including subscribe/onlineLogin).