Webportal v2

embedded apps

    Quickstart - Get Started

    GETTING STARTED #

    You will need to contact PSA Team in order to become a partner and deploy your apps on the Webportal so you should start by doing so. The team will also be able to help you with questions you might have.

    HTML #

    The HTML part of your project is conventional, you create your objects and static content.

    <!-- STYLES -->
    <link rel="stylesheet" type="text/css" href="css/main.css">
    <!-- SCRIPTS -->
    <script type="text/javascript" src="../test/shared/libs/jquery/1.10.0/jquery.js"></script>
    <script type="text/javascript" src="js/main.js"></script>
    
    <div id="mainContainer">
        Hello World!
    </div>
    

    Be carefull: your app is a single page application. It mean that you must have only one html file (‘index.html’) in your project.

    CSS #

    You can customize your CSS stylesheet, here is simply an example changing the color of the text displayed.

    // Your normal css file
    #mainContainer {
        color: blue;
    }
    

    JS #

    Here you have the required JS for your application to function properly. You can add the functions you need to handle other events.

    //On document ready
    document.addEventListener("DOMContentLoaded", function(event) {
    
      // Inform the parent window (applications portal) that the application is
      // loaded and ready
      var requestId = generateRandomId();
      parent.postMessage('*', {
        "id": requestId, 
        "type": "SET", 
        "api": "Vehicle.Cabin.Infotainment.WebApps.Application.LoadingStatus", 
        "params": {
          "appId": "com.example.app",
          "status": "loading" 
        }
    });
    

    Doing so you inform the parent window (applications portal) that the application is loaded and ready.

    To develop Webportal Applications you have to use postMessage and onmessage browser APIs.

    Learn more about the various messages by reading what are Get, Set & Subscribe verbs.

    This way you will be able to send a request and to receive a response from/to webportal!