cancel
Showing results for 
Search instead for 
Did you mean: 

SMP3.0 SP05 register process and reconnect in native iOS app

Former Member
0 Kudos

Hi,

we do this steps to get a native iOS application functioning through the SAP Mobility platform version 3.0 SP05 and retrieving data from OData services.

But we do not understand the register process completely.

If we install the app and do the register process and retrieve the data everything is ok. A user with the ApplicationConnectionID is registered in in SMP. But if we start the app again (without a new installation) we do not register the user again an set the connection id we get in the registration process:

[self.clientConn setApplicationConnectionID:[selfreadInPlistMitKey:@"appConnectionID"]];


we set the encryptionKey in the manager and initialize the Cache once for the application launch.

[EncryptionKeyManager setEncryptionKey:key withError:nil];


But if we want to retrieve the data we get a Request Failed.


2015-01-15 18:13:31.885 AuthTest[12663:5b07] Firing requests from DB...

2015-01-15 18:13:31.886 AuthTest[12663:4c07] UrlString:   http://smpServerAdress:8080

2015-01-15 18:13:31.889 AuthTest[12663:4c07] Connectivity changed...

2015-01-15 18:13:31.889 AuthTest[12663:4c07] Detected network...

2015-01-15 18:13:31.889 AuthTest[12663:4c07] Start queue...

2015-01-15 18:13:31.900 AuthTest[12663:4c07] UrlString:   http://smpServerAdress:8080

2015-01-15 18:13:31.906 AuthTest[12663:907] Request Failed


What do we wrong? Where is the different between the request with registration an without.

Thanks,

André

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The Problem and in general the use of HttpConversion and the communication between iOS Client and SMP 3.0 was discussed with on this place:

Thanks again Stan.

Best regards André

Answers (1)

Answers (1)

Ali_Chalhoub
Advisor
Advisor
0 Kudos

Can you please share your code? The OData should URL when making the call after the registration is successful, it should look something like this:

http://<SMP-HOST-NAME>:8080/<application-ID>

You need to pass the X-SMP-APPCID with the application connection ID value.

Thank you


Former Member
0 Kudos

Hi Ali,

I attached the SMPController File where the register and connection logic is defined.

Where do I get the  X-SMP-APPCID and where must i set this ID? Can you show me the place in the api?

Thanks,

André

Ali_Chalhoub
Advisor
Advisor
0 Kudos

We looked at your file and you are using the old way of the SDK. Please follow the steps in this blog. These are up-to-date and you will find it very useful.

http://scn.sap.com/docs/DOC-58677#iOS

Than you

Former Member
0 Kudos

Thanks Ali,

i will try it out.

André

Former Member
0 Kudos

Hi Ali,

if we don't want to use the MAFLogonScreen because of the user should not set the login credentials by him self. How could we set the login credentials in the HttpConversationManager programmtically?





Ali_Chalhoub
Advisor
Advisor
0 Kudos
Former Member
0 Kudos

Hi Ali,

thank you but this was not realy what we need. But we can now register without to use the MAFLogonScren but when we whant to open the Online Store we get this error: "OpenStore failed with network error: 401 unauthorized" Do you know what we cvan do against this error or what the reason of this error is?

Here is the code snipped what we use:

    MAFLogonUIViewManager *logonUIViewManager = [[MAFLogonUIViewManager alloc] init];

    NSObject<MAFLogonNGPublicAPI> *logonManager= logonUIViewManager.logonManager;

    HttpConversationManager* httpConvManager = [[HttpConversationManager alloc] init];

    [[logonManager logonConfigurator] configureManager:httpConvManager];

    MAFLogonCore *lc = self.appDelegate.lc;

    MAFLogonContext *context;

    if ([lc unlockSecureStore:@"abcd1234" error:&error]) {

       

        context = [lc getContext:&error];

       

    }

    MAFLogonRegistrationContext *regContext = context.registrationContext;

   

    SODataOnlineStore *onlineStore = [[SODataOnlineStore alloc]

                                      initWithURL:[NSURL URLWithString:regContext.applicationEndpointURL]

                          httpConversationManager:httpConvManager];

    [onlineStore setOnlineStoreDelegate:self];

    [onlineStore openStoreWithError:&error];

Ali_Chalhoub
Advisor
Advisor
0 Kudos

For that one I suggest you first test it on a browser to see if you can register and do a get against the End-pont. The reason I am saying because you want to see if the authentication module and profile are configured correctly in SMP.

Ali_Chalhoub
Advisor
Advisor
0 Kudos

I am not sure if you saw this document to do the registration without MAF.

http://scn.sap.com/docs/DOC-60196

thx