Switching between native and web views
In iOS and Android applications, natively developed pages can be invoked from the web-based pages and can then return control to the web view and vice versa. We can pass data from the web page to the native page, and return data in the opposite direction. We can also animate the transition between the pages in both directions.
Switching to a native view from a web view
To switch the display from the web view to a native page, use the WL.NativePage.show method.
Authenticating in native and retrieving user information in web view
The MobileFirst JavaScript API provides the following methods for retrieving authenticated user information, such as the login name, display name, or any other custom user identity property.
- WL.Client.updateUserInfo()
- WL.Client.getLoginName()
- WL.Client.getUserInfo()
- WL.Client.getUserName()
The preceding methods are available in the JavaScript API only. If the application implements authentication in the native layer and only then moves to the web layer, we must invoke WL.Client.updateUserInfo() methods in order to retrieve authenticated user information from the MobileFirst Server.
Parent topic: Web and native code in iPhone, iPad, and Android