General information
To display any of the HOME Interfaces Web Components, please follow these requirements and guidelines :- Import the scripts associated with the HOME Interfaces Web Components.
- Authenticate the logged-in user using the authentication web component (more details in this documentation).
- Place the web componentâs tag in your codebase.
In a Web App
To use our web components, please follow the following steps for production or qa environment. The variable BASE_URI_ENVIRONMENT has to be replaced with one of the following value from desired environment.- Production
- QA
BASE_URI_ENVIRONMENT :
https://static.home.datanumia.comStep 1 : Import the pre-prepared JavaScript files and stylesheets
You will need to import the JavaScript modules used to instantiate the HOME Interfaces Web Component.Important !
The polyfill script must be placed BEFORE the import of the main.js script for each offer.Donât forget to replace the variable BASE_URI_ENVIRONMENT from the needed environment.
Step 2 : Configure authentication with our dedicated component
Once you have completed the previous steps, please authenticate using thedtn-integration-requirements web component you just imported. This custom element is provided by the basis import.
In this example, weâve chosen to use a Datanumia token. If you prefer to use your own application token, thatâs possible and explained in detail in the dedicated section. You can find more details on this specific step in the âSecurityâ section.
Step 3 : Use the web components wherever you want
To finalize the web app implementation, simply place the web component wherever you prefer. For example, if you choose to place it on your main page (i.e., in theindex.html file), you will have the following code:
Internationalization
The HOME Interfaces web components handle internationalization, which mean that they support multiple languages. To load a specific language, please refer to the RFC5646 format of the desired language.If the language is not supported yet, you may enconter a 404 http status when trying to load the javascript module.
fr: French language (France)en-GB: English language (Great britain)
Link for each language
This following import will load thedtn-consumption-monitoring web component in dedicated language.
FR
en-GB
In a Mobile App
The implementation details depend on the targeted system. In the following section, we will focus on the Android and iOS environments using native applications, built respectively with Java (or Kotlin) and Swift. The implementation demonstrated will be based on WebView technology, which allows developers to display web content inside a native application. Some specific configurations are required to enable the use of HOME Interfaces Web Component inside these WebViews.Loading the web components
Please create an HTML page to be used as the WebView content. This page should be built using the guidelines previously mentioned in the web application section. If you want to serve the same web page to multiple applications, you can use a distant html page.Authentication in Android WebView
You can update the authentication token using theevaluateJavascript method provided by the WebView objects. This allows the dtn-authentication web component to receive a token as specified in the documentation about security in the HOME Interfaces context.
- Android (Java)
- IOS (Swift)
- IONIC
Application authorizations
In an Android environment, you will need to grant specific authorizations to both the WebView and the application itself.Android application permissions
- Internet: To retrieve the static resources needed to display the HOME Interfaces, the application must be allowed to make network requests.
Permissions for the WebView integrating the HOME Interfaces
- JavaScript: The HOME Interfaces rely on web components technology, which requires JavaScript execution.
- DOM Storage: The HOME Interfaces components use browser storage mechanisms.
- Allow file access: Required if you plan to use a local
index.htmlfile.