使用sup 2.1.3(SUP服务器)开发ios本机应用程序。但是我在sybase控制中心注册设备时遇到了以下错误。我已经搜索了这个,但我没有得到任何解决方案..任何人都可以帮我解决这个问题吗?
我的代码:
SUPConnectionProfile *sp = [self.connectionProfile syncProfile];
[sp setDomainName:@"default"];
[sp setServerName:@"john-PC"];
[sp setPortNumber:2480];
[sp setNetworkProtocol:@"http,https"];
[sp setNetworkStreamParams:@"trusted_certificates=;url_suffix="];
[sp applyPropertiesFromApplication];
code for registering the device :
@try
{
SUPApplication* app = [SUPApplication getInstance];
[app registerApplication:120]; // here i'm increasing to 60 10 120
@catch (SUPApplicationTimeoutException* tex)
{
NSLog(@"SUPApplicationTimeoutException");
NSLog(@"%@: %@--%@", [tex name],[tex message], [tex description]);
[self.loader hide:YES];
}
@catch (SUPPersistenceException * pe) {
NSLog(@"SUPPersistenceException");
NSLog(@"%@: %@", [pe name],[pe message]);
[self showNoTransportAlert:kSUP102ErrorFailure];
}
}
错误控制台:
2014-03-25 14:12:49.085 SUP102[1891:6303] =================================================
2014-03-25 14:12:49.085 SUP102[1891:6303] onConnectionStatusChanged: status = 105, code = 571, message = Error: 571 Detail: Session failed Source: /Users/iotabuilder/svn/Pioneer/MOClients/iPhone/../Common/C/moClient.cpp 1024.
2014-03-25 14:12:49.086 SUP102[1891:6303] =================================================
2014-03-25 14:12:49.087 SUP102[1891:6303] =================================================
2014-03-25 14:12:49.087 SUP102[1891:6303] onConnectionStatusChanged: status = 105, code = 571, message = Error: 571 Detail: Session failed Source: /Users/iotabuilder/svn/Pioneer/MOClients/iPhone/../Common/C/moClient.cpp 1024.
2014-03-25 14:12:49.087 SUP102[1891:6303] =================================================
答案 0 :(得分:0)
您应该按照标准示例进行注册:
SUPApplication* app = [SUPApplication getInstance];
[app setApplicationIdentifier:@"YOURAPPIdentifier"];
MyApplicationCallbackHandler *ch = [MyApplicationCallbackHandler getInstance];
[app setApplicationCallback:ch];
SUPConnectionProperties* props = app.connectionProperties;
[props setServerName:@"supserver.mycompany.com"];
[props setPortNumber:5001]; // the messaging
SUPLoginCredentials* login = [SUPLoginCredentials getInstance];
login.username = @"username";
login.password = @"password";
props.loginCredentials = login;
[app registerApplication:120]; // 120 second timeout for registration
不要设置协议,域,网络流参数等...