我是本机应用程序开发的初学者。我使用 xcode 制作了一个项目。我使用 SAP 作为我的后端。现在我正在尝试连接到服务器。为此,我使用 SUPConnectionProperties.h 文件设置了连接属性以进行注册和编写了用于创建本地数据库的代码。现在下一步,即设置同步配置文件对我不起作用。因为方法 setServerName、setNetworkProtocol、setPortNumber 和 setAsyncReplay 在 SUPConnectionProfile.h 中不存在。
那么我该怎么做才能包含这些方法并执行此步骤?任何人都可以为此提出任何建议。我在这里给出方法,有问题。
-(BOOL)setupApplicationConnection{
SUPApplication *app = [SUPApplication getInstance];
[app setApplicationIdentifier:@"HWC"];
[app setApplicationCallback:self.callbackHandler];
SUPConnectionProperties *properties = [app connectionProperties];
[properties setServerName:@"sapeccxxx.xxx.com"];
[properties setPortNumber:5001];
[properties setFarmId:0];
[properties setUrlSuffix:@"/tm/?cid=%cid%"];
[properties setNetworkProtocol:@"http"];
SUPLoginCredentials *loginCred =[SUPLoginCredentials getInstance];
[loginCred setUsername:@"ourmac"];
[loginCred setPassword:nil];
[properties setLoginCredentials:loginCred];
[properties setActivationCode:@"1234"];
if(![flightDetailsTest_Flightdetails_v1DB databaseExists])
{
[flightDetailsTest_Flightdetails_v1DB createDatabase];
}
SUPConnectionProfile *connProfile = [flightDetailsTest_Flightdetails_v1DB getSynchronizationProfile];
[connProfile setClientId:@"0" ];
[connProfile setDomainName:@"Development"];
[connProfile setUser:@"ourmac"];
[connProfile setPassword:@"password"];
**[connProfile setNetworkProtocol:@"http"];**
**[connProfile setPortNumber:2480];**
**[connProfile setServerName:@"sapeccxxx.xxx.com"];**
**[connProfile setAsyncReplay:YES];**
[flightDetailsTest_Flightdetails_v1DB registerCallbackHandler:self.callbackHandler];
[flightDetailsTest_Flightdetails_v1DB setApplication:app];
if([SUPApplication registrationStatus] == SUPRegistrationStatus_REGISTERED)
{
[app startConnection:0];
}
else{
[app registerApplication:0];
}
}
有问题的方法用粗体字表示。