cancel
Showing results for 
Search instead for 
Did you mean: 

SUP 2.1.2: iOS application fails to subscribe

Former Member
0 Kudos

Folks,

I am writing a native iOS 5.1 app for iPad that talks with SUP server. The earlier version of the app written for SUP 2.1.0 worked fine, but 2.1.2 made SUPMessageClient obsolete, so I had to rewrite it using SUPApplication. I get past registration, and log in is successful, too, but where the problem starts in on subscription. My code to do this in onLoginSuccess callback handler is this:

- (void)onLoginSuccess

{

    MBOLogInfo(@"Login Successful");

    DealerPortalUser_mapSynchronizationParameters *userSyncParameters = [DealerPortalUser_map getSynchronizationParameters];

    userSyncParameters.user_syn = [[NSUserDefaults standardUserDefaults] stringForKey:@"username_preference"];

    [userSyncParameters save];

    if([DealerPortalDealerPortalDB isSubscribed]) {

        [DealerPortalDealerPortalDB beginSynchronize];

    } else {

        [DealerPortalDealerPortalDB subscribe];

    }

}

When this is executed, event onSubscribeFailure is triggered. My trace shows the following errors:

2012-04-23 15:10:28.030 Basalite2[1776:13803] [[MBS TRACE HEADER]][DEBUG] {"pv":"2","id":"1335219026","app":"Basalite2","subscribed":false,"method":"loginResult","pkg":"dealerportal:1.0","cid":91404540}

2012-04-23 15:10:28.052 Basalite2[1776:13803] [INFO] [CPCallbackHandler.m:74] Login Successful

2012-04-23 15:10:28.075 Basalite2[1776:13803] [[MBS TRACE HEADER]][DEBUG] The message header sending out :

2012-04-23 15:10:28.076 Basalite2[1776:13803] [[MBS TRACE HEADER]][DEBUG] {"pv":"1","id":"91805540","app":"Basalite2","appId":"dealerportal","nosub":true,"method":"replay","mbo":"User_map_pull_pq","pkg":"DealerPortal:1.0"}

[Switching to process 1776 thread 0x13803]

[Switching to process 1776 thread 0x13803]

Current language:  auto; currently objective-c

2012-04-23 15:10:33.937 Basalite2[1776:13803] [[MBS TRACE HEADER]][DEBUG] The message header sending out :

2012-04-23 15:10:33.937 Basalite2[1776:13803] [[MBS TRACE HEADER]][DEBUG] {"pv":"1","os":"iPhone OS 5.1","id":"1335219027","app":"Basalite2","appId":"dealerportal","nosub":true,"method":"subscribe","pkg":"DealerPortal:1.0"}

2012-04-23 15:10:34.238 Basalite2[1776:13803] [[MBS TRACE HEADER]][DEBUG] The message header received :

2012-04-23 15:10:34.238 Basalite2[1776:13803] [[MBS TRACE HEADER]][DEBUG] {"pv":"2","id":"91805540","app":"Basalite2","mbo":"User_map_pull_pq","method":"replayResult","pkg":"dealerportal:1.0","cid":91404628}

2012-04-23 15:10:34.241 Basalite2[1776:13803] [INFO] [CPCallbackHandler.m:60] Replay Successful

2012-04-23 15:10:35.649 Basalite2[1776:13803] [[MBS TRACE HEADER]][DEBUG] The message header received :

2012-04-23 15:10:35.650 Basalite2[1776:13803] [[MBS TRACE HEADER]][DEBUG] {"pv":"2","loginFailed":false,"id":"1335219027","app":"Basalite2","log":[{"_rc":0,"operation":"subscribe","eisCode":"0","messageId":4200001,"timestamp":"2012-04-23 22:10:35.409","entityKey":null,"_op":"N","level":5,"message":"java.sql.SQLException:JZ006: Caught IOException: java.net.ConnectException: Connection refused: connect","requestId":"1335219027","code":503,"component":"DealerPortalDB"}],"method":"subscribeFailed","pkg":"dealerportal:1.0","cid":91404628}

2012-04-23 15:10:39.155 Basalite2[1776:13803] [ERROR] [CPCallbackHandler.m:102] Subscribe Failed

The message that I see on SUP server side (not sure if relevant) in VMUNWIRED-DEV_OBMO_MOLogMobileObjects log file:

20120423T153746.055|2|Event Type: ERROR__Error Message: Object Name: 'GetDeviceLogs'__Error Detail: The named MOCA object was not registered on the device.__|alexei|SIMULATOR-ALEXEI__DEALERPORTAL

There are also some more errors in server logs as to the effect of APNS server not being set up, but I don't use APNS connection, and don't think it is required in 2.1.2 (it wasn't in 2.1.0).

Any ideas where else to look?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I managed to make it working by clearing anything deployed previously in SCC, removing registered applications and registrations, redeploying everything and regeneration iOS code for MBOs and moving it to my application.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Isaev,

If you open DealerPortalUser.db in sqlite3 you will find table a LogRecordImpl that will have few more information, that might help you

Regards,

Srinivas Divakarla

 

Former Member
0 Kudos

logrecordimpl table was actually empty

Former Member
0 Kudos

Hi Isaev,

I think it would be nice if you could the subscription and synchronization onReplaySucess instead of onLoginSuccess

Regards,

Srinivas Divakarla

Former Member
0 Kudos

According to Sybase docs (http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01217.0212/doc/html/jwo13...) all prerequisites for subscription should be met in onLoginSuccess() event. Anyway, my application worked with 2.1.0 when I had my code the way I show it in question.