Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
kenichi_unnai
Advisor
Advisor

Hi everyone.

Onboarding. User on-boarding is the process of registering a user and giving them appropriate access to data and applications. SMP offers the proven onboarding scheme together with the API.

OData SDK bundles the Mobile Application Framework(MAF) UI. With the MAF UI, you can use the out-of-the-box onboarding features with very minimal development effort.

Let's have a look at the typical onboarding implementation with MAF UI.

01  MAFLogonUIViewManager *logonUIViewManager = [[MAFLogonUIViewManager alloc] init];
02  [logonUIViewManager.logonManager setApplicationId:appID];
03  [logonUIViewManager.logonManager setLogonDelegate:self];
04  [logonUIViewManager.logonManager logon]; // Shows MAF UI

The appID in #02 is the application id, which is configured in the SMP server. #03 is for the delegate named MAFLogonNGDelegate. #04 renders the MAF UI for end user. Once the end user entered all the onboarding info (SMP server name, credentials, etc.), the logonFinishedWithError: method is called back - this method is defined in the MAFLogonNGDelegate. Once the method is called back, make sure we configure the HttpConversationManager in the logonFishedWithError:.

01  -(void) logonFinishedWithError:(NSError*)anError
02  {
03    ...
04    HttpConversationManager *httpConvManager = [[HttpConversationManager alloc] init];
05    [[logonUIViewManager.logonManager logonConfigurator] configureManager:httpConvManager];
06    // onboarding completed
07  }

Remember the HttpConversationManager in the blog#02? Once completing the steps above, we can happily use the HttpConversationManager instance to create the ODataStore instance.


One remark is the logonUIViewManager needs the topmost ViewController so it can display the logon screens as modal screens on top of it. This code demonstrates how to set the current ViewController as the parentViewController of the logonUIViewManager.


Note: You have to make sure the parentViewController is set before the logon method gets called.

01  - (void)viewWillAppear:(BOOL)animated
02  {
03        ..
04    logonUIViewManager.parentViewController = self;
05        ..
06  }

Once the onboarding is completed, we can access the user specific onboarding data. This code fetches the OData application endpoint URL that routes the SMP server as a content proxy.

01  MAFLogonRegistrationData *regData = [logonUIViewManager.logonManager registrationDataWithError:&error];
02  NSString *endpointUrl = regData.applicationEndpointURL;

That's all for the onboarding step with MAF UI. Without onboarding, you can't obtain the ODataStore instance, so it is a must knowledge for you.


Next one is offline API 🙂



See you in the next blog,

Ken


List of blogs

16 Comments