WebViews
Learn what a WebView is and how they are used in your applications.
WebViews
What is a WebView?
A WebView is a web browser that is embedded within an app.
Configuration
Before Bright Energy can make a Get WebView url request you will need to send us a list of WebViews you would like to be available in the app.
Each item in the list should include:
- View Name
- urlKey
(camelCasedKeyName)
- Value (camelCasedKeyValue or full URL string)
- App location for the WebView to be available to users
- openInBrowser
(boolean)(set to true to open in external Browser App instead)
WebView Flows:
Shared View:
- Bright Energy saves a
urlKey
value that corresponds with a finalUrl - termsAndConditions -> https://organisationDomain.com/termsAndConditions
- The finalUrl is rendered and Bright Energy does not make a Get WebView url request.
User Specific View:
- Bright Energy stores the name of the
urlKey
and uses it to make a Get WebView url request - termsAndConditions -> termsAndConditions
- We request Get WebView url with all the query parameters (userid, locationid etc...)
- The Organisation computes a finalUrl and responds to the Get WebView url request
- Bright Energy renders this finalUrl as a WebView in the app.
Example:
WebViews can be used for opening webpages for user actions not currently supported by the app such as the renewal of an agreement.
You have previously given us a view name called Account Renewal
with the urlKey accountRenewal
to be located inline with existing agreements for the account.
Bright Energy will then request your Get WebView url endpoint with the following structure:
https://{kitEnvironment}.{kitDomain}/{kitBasePath}/webview?accountid={accountId}&clientId=app&language=sv&urlkey=accountRenewal&serviceId={serviceId}&userId={userId}
.
Your response body has the computed finalUrl set as the value of the body parameter with key url
. The finalUrl should include everything needed to load the WebView (authentication, tracking, etc...) so that Bright Energy can successfully render the WebView for the user.
Updated 21 days ago