on 02-26-2014 6:28 AM
hello,
I m trying to connect a SMP server(2.3 version) via an IOS application which is giving me a onHttpCommunicationError at time of registration while the same server when I m connecting via an android application is connecting without any issue.
Please help me in this problem if possible then please provide me with the Connection code i.e ios code to connect SMP server.
Hi Anu,
I have resolved that error and now my code is compiling without errors. But I want to connect to relay server and my registered user in sybase control center is not showing as online. I have added all the required relay server settings in my code. Please find below my code and let me know if I missed something.
SUPApplication *app=[SUPApplication getInstance];
[app setApplicationIdentifier:APPLICATION_IDENTIER];
[app setApplicationCallback:self.callbackHandler];
[Demo_AppDemo_AppDB registerCallbackHandler:self.callbackHandler];
SUPConnectionProperties* props = app.connectionProperties;
[props setServerName:server];
[props setPortNumber:CONTROL_PORTNUMBER]; //80 HTTP or 443 for HTTPS
[props setNetworkProtocol:CONTROL_PROTOCOL]; // or https for secure connection
[props setUrlSuffix:@"/ias_relay_server/client/rs_client.dll/MBSFARMID/"];
[props setFarmId:CONTROL_FARMID];
SUPLoginCredentials* login = [SUPLoginCredentials getInstance];
login.username = app_user; // same as in Application Connection
login.password = nil;
props.loginCredentials = login;
props.activationCode = activation;// same as in Application Connection
props.securityConfiguration =CONTROL_SECURITY_CONFIG;
SUPConnectionProfile *sp = [ Demo_AppDemo_AppDB getSynchronizationProfile];
[sp setUser:scc_username];
[sp setPassword:scc_password];
[sp setAsyncReplay:NO];
[sp setServerName:server];
[sp setPortNumber:CONTROL_PORTNUMBER]; // or 80 for http
[sp setNetworkProtocol:CONTROL_PROTOCOL];
With Regards
Neha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also got the similar issue I was able to resolve it by enabling a flag :
Go to SCC ->Go to ypur Domain ->Select Application -> Go to Application Connection Tab in it -> select your application connection and select Properties there atleft hand side u'll find a tab as Apple Push Notification -> set the enabled value as True.
Try this..
Which farm id u r using RBS or MBS for connection.
It is very simple.
We need to maintain two profiles through code.
server: Relay server
port: 80/443
Farm ID: MBS
2. Synchronization profile
server: Relay server
port: 80/443
stream paramter: url suffix(/ias_relay_server/client/rs_client.dll/RBS farm ID)
Hi,
Now i am developing a native iOS app using SMP 2.3 MBO approach so i have used SMP Object API includes and libraries.But in the later time I have to develop native iOS app using Odata services and SMP 2.3. So I just want to know is there any difference in connecting the Odata services through Relay server or the procedure would be same as the header files we are using in the relay server connection code are available in Object API includes folder(ex: SUPApplication) in SMP and for Odata there is seperate includes folder in which those files are not available.
Thanks
Neha
MBO app development for iOS and OData app development for iOS are totally different and independent approaches.
In case of mbo based app, you have to do mbo modeling first, deploy it to server, generate code. The same code has to be merged with UI along wth iOS object APIs files available in Mobil SDK path.
Whereas for OData based apps, there are different libraries files available in mobile sdk path.
Both apps development have to be done separately. Don't mix mbo objectapi with either odata's one in case of any kind of connectivity.
Hi,
I am creating a native iOS application using smp2.3. I want the application to be connected through Relay server but i am not able to understand as where to put the relay server connection properties.
I have put the below code in Appdelegate.m:
SUPConnectionProperties* props = app.connectionProperties;
[props setServerName:self.serverName];
[props setPortNumber:[self.serverPort intValue]];
[props setUrlSuffix:@""];
[props setFarmId:self.farmID];
SUPLoginCredentials* login = [SUPLoginCredentials
getInstance];
if(self.manualRegistration)
{
login.username = self.connectionName;
login.password = nil;
props.activationCode = self.activationCode;
} else {
}
props.loginCredentials = login;
login.username = self.userName;
login.password = [smp101vault getString:@"password"];
props.activationCode = nil;
when I am compiling the app it is giving errors like sybase.sup.h, SUPClassMetaDataRBS.h file missing and use of undeclared identifier SUPConnectionProperties.
Please help me in resolving this error.
Thanks
Neha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Neha,
you need to import the required files in the where u r writing this code.
have you added the required file in ur project if yes then have yoy set the Header Search Path in the Build Settings.
You can follow the steps from this pdf :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have used following code :
app.applicationIdentifier = @"app_name";
SUP101CallbackHandler *ch = [SUP101CallbackHandler getInstance];
[ch retain];
[app setApplicationCallback:ch];
SUPConnectionProperties *props = app.connectionProperties;
[props setServerName:@"relay_server_name"];
[props setPortNumber:[@"port_number" intValue]];
[props setFarmId : @"farm_id"];
SUPLoginCredentials *login = [SUPLoginCredentials getInstance];
login.username = @"user_name";
login.setPassword = @"pass";
props.activationCode = nil;
props.loginCredentials = login;
[*****DB setApplication:app];
@try{
[app registerApplication : 30];
}
@catch(Exception *ex){
NSLog(@"Exception : ",[ex reason]);
}
[*****DB openConnection];
if(![[*****DB databaseExists])
{
[*****DB createDataBase];
}
else
{
[*****DB deleteDatabase];
[*****DB createDataBase];
}
SUPConnectionProfile *cp = [*****DB getSynchronizationProfile];
[cp setUser : @"user_name"];
[cp setPassword : @"pass"];
[cp setServerName : @"relay_server_name"];
[cp setPortNumber :[@"port_number" intValue]];
[cp setDomainName : @"domain"];
[cp setNetworkProtocol : @"http"];
[cp setNetworkStreamsParam : @"trusted_certificates='compression=none;url_suffix=/ias_relay_server/Client/rs_client.dll/RBS_FARM_ID"];
[*****DB registerCallbackHandler:callbackHandler];
@try{
****LocalKeyGenerator *gene = [****LocalKeyGenerator getInstance];
[gene save];
[*****DB synchronize];
}
@catch(Exception *ex){
NSLog(@"Exception while synchronizing : ",[ex reason]);
}
hey jitendra,
I have successfully registered and connected the app and its now visible on the SCC also.
But now the issue is that I am not able to call save method on the LBO instance it is giving me a following exception:
NSInvalidArgumentException : -[ __NSCFString appendString :] nil argument.
LBO object is not null and it even contains values in all fields.
Please guide me.
User | Count |
---|---|
90 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.