- Xcode 9.3 or above
- iOS 11 SDK
- Liferay Portal 6.2 CE/EE, Liferay CE Portal 7.0/7.1, Liferay DXP 7.0+
- Liferay Screens Compatibility app (CE or EE/DXP). This app is preinstalled in Liferay CE Portal 7.0/7.1 and Liferay DXP 7.0+.
- iOS 9 and above
- Visual Studio 7.2
- Mono .NET framework 220.127.116.11
The Web Content Display Screenlet shows web content elements in your app, rendering the inner HTML of the web content. The Screenlet also supports i18n, rendering contents differently depending on the device’s current locale.
Screenlets in Liferay Screens call JSON web services in the portal. This Screenlet calls the following services and methods.
The Default Theme uses a standard
UIWebView to render the HTML. Other Themes
may use a different component, such as iOS 8’s.
For the Web Content Display Screenlet to function properly, there should be web content in the Liferay instance your app connects to. For more details on web content, please refer to the Creating Web Content section of the Liferay User Guide.
This Screenlet supports offline mode so it can function without a network connection. For more information on how offline mode works, see the tutorial on its architecture. Here are the offline mode policies that you can use with this Screenlet:
|Policy||What happens||When to use|
|The Screenlet loads the content from the portal. If a connection issue occurs, the Screenlet uses the delegate to notify the developer about the error. If the Screenlet successfully loads the content, it stores the data in the local cache for later use.||Use this policy when you always need to show updated content, and show nothing when there’s no connection.|
|The Screenlet loads the content from the local cache. If the content isn’t there, the Screenlet uses the delegate to notify the developer about the error.||Use this policy when you always need to show local content, without retrieving remote content under any circumstance.|
|The Screenlet loads the content from the portal. If this succeeds, the Screenlet shows the content to the user and stores it in the local cache for later use. If a connection issue occurs, the Screenlet retrieves the content from the local cache. If the content doesn’t exist there, the Screenlet uses the delegate to notify the developer about the error.||Use this policy to show the most recent version of the content when connected, but show a possibly outdated version when there’s no connection.|
|The Screenlet loads the content from the local cache. If the content isn’t there, the Screenlet requests it from the portal and notifies the developer about any errors that occur (including connectivity errors).||Use this policy to save bandwidth and loading time in case you have local (but probably outdated) content.|
If you have
structured web content,
you can alternatively use
|The site (group) identifier where the asset is stored. If this value is |
|The identifier of the web content to display. You can find the identifier by clicking Edit on the web content in the portal.|
|The identifier of the template used to render the web content. This is applicable only with structured web content.|
|The identifier of the |
|Whether the content should be retrieved from the portal as soon as the Screenlet appears. The default value is |
|Starts the request to load the web content. The HTML is rendered when the response is received. Returns |
The Web Content Display Screenlet delegates some events to an object that
conforms to the
WebContentDisplayScreenletDelegate protocol. This protocol
lets you implement the following methods:
- screenlet:onWebContentResponse:: Called when the web content’s HTML is received.
- screenlet:onWebContentError:: Called when an error occurs in the process. The
NSErrorobject describes the error.
- screenlet:onRecordContentResponse:: Called when a web content record is received.
- screenlet:onUrlClicked:: Called when a URL is clicked in the web content. Return
trueto handle the navigation, or
falseto cancel it.