Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
JavaSE Guides
Creating an OEM Cloud App Store

Creating an OEM Cloud App Store (RPC v5.1+)

SDL allows OEMs to offer an app store that lets users browse and install remote cloud apps. If the cloud app requires users to login with their credentials, the app store can use an authentication token to automatically login users after their first session.

Note

An OEM app store can be a mobile app or a cloud app.

User Authentication

App stores can handle user authentication for the installed cloud apps. For example, users can log in after installing a cloud app using the app store. After that, the app store will save an authentication token for the cloud app in the local policy table. Then, the cloud app can retrieve the authentication token from the local policy table and use it to authenticate a user with the application. If desired, an optional parameter, CloudAppVehicleID, can be used to identify the head unit.

Setting and Getting Cloud App Properties

An OEM's app store can manage the properties of a specific cloud app by setting and getting its CloudAppProperties. This table summarizes the properties that are included in CloudAppProperties:

Parameter Name Description
appID appID for the cloud app
nicknames List of possible names for the cloud app. The cloud app will not be allowed to connect if its name is not contained in this list
enabled If true, cloud app will be displayed on HMI
authToken Used to authenticate the user, if the app requires user authentication
cloudTransportType Specifies the connection type Core should use. Currently Core supports WS and WSS , but an OEM can implement their own transport adapter to handle different values
hybridAppPreference Specifies the user preference to use the cloud app version, mobile app version, or whichever connects first when both are available
endpoint Remote endpoint for websocket connections
Note

Only trusted app stores are allowed to set or get CloudAppProperties for other cloud apps.

Setting Cloud App Properties

App stores can set properties for a cloud app by sending a SetCloudAppProperties request to Core to store them in the local policy table. For example, in this piece of code, the app store can set the authToken to associate a user with a cloud app after the user logs in to the app by using the app store:

CloudAppProperties cloudAppProperties = new CloudAppProperties("<appId>");
cloudAppProperties.setAuthToken("<auth token>");
SetCloudAppProperties setCloudAppProperties = new SetCloudAppProperties(cloudAppProperties);
setCloudAppProperties.setOnRPCResponseListener(new OnRPCResponseListener() {
    @Override
    public void onResponse(int correlationId, RPCResponse response) {
        if (response.getSuccess()) {
            DebugTool.logInfo("SdlService", "Request was successful.");
        } else {
            DebugTool.logInfo("SdlService", "Request was rejected.");
        }
    }
});
sdlManager.sendRPC(setCloudAppProperties);

Getting Cloud App Properties

To retrieve cloud properties for a specific cloud app from local policy table, app stores can send GetCloudAppProperties and specify the appId for that cloud app as in this example:

GetCloudAppProperties getCloudAppProperties = new GetCloudAppProperties("<appId>");
getCloudAppProperties.setOnRPCResponseListener(new OnRPCResponseListener() {
    @Override
    public void onResponse(int correlationId, RPCResponse response) {
        if (response.getSuccess()) {
            DebugTool.logInfo("SdlService", "Request was successful.");
            GetCloudAppPropertiesResponse getCloudAppPropertiesResponse = (GetCloudAppPropertiesResponse) response;
            CloudAppProperties cloudAppProperties = getCloudAppPropertiesResponse.getCloudAppProperties();
            // Use cloudAppProperties
        } else {
            DebugTool.logInfo("SdlService", "Request was rejected.");
        }
    }
});
sdlManager.sendRPC(getCloudAppProperties);

Getting the Cloud App Icon

Cloud app developers don't need to add any code to download the app icon. The cloud app icon will be automatically downloaded from the url provided by the policy table and sent to Core to be later displayed on the HMI.

Getting the Authentication Token

When users install cloud apps from an OEM's app store, they may be asked to login to that cloud app using the app store. After logging in, app store can save the authToken in the local policy table to be used later by the cloud app for user authentication.
A cloud app can retrieve its authToken from local policy table after starting the RPC service. The authToken can be used later by the app to authenticate the user:

String authToken = sdlManager.getAuthToken();

Getting CloudAppVehicleID (Optional)

The CloudAppVehicleID is an optional parameter used by cloud apps to identify a head unit. The content of CloudAppVehicleID is up to the OEM's implementation. Possible values could be the VIN or a hashed VIN.
The CloudAppVehicleID value can be retrieved as part of the GetVehicleData RPC. To find out more about how to retrieve CloudAppVehicleID, check out the Retrieving Vehicle Data section.

View on GitHub.com
Previous Section Next Section