jquerysapui5

Separate homeicons for android and ios using sap.m.Shell


The current ui5 documentation dynamically selects the icon based on the device type like phone,tablet e.t.c.:

function(Shell, ComponentContainer) {
    new Shell({
        homeIcon: {
            favicon: "img/favicon.ico",
            phone: "img/logo_57px.png",
            "phone@2": "img/logo_114px.png",
            tablet: "img/logo_72px.png",
            "tablet@2": "img/logo_144px.png",
            precomposed: false // whether the home icons already have some glare effects (for iOS)
        },
        app: new ComponentContainer({
            component: createdComponent,
            height: "100%"
        })
    }).placeAt("content");
});

Is there a possibility of creating separate homeicons for Android and iOS devices, so that when the application is downloaded and installed in an android device, one homeicon can be shown and a separate icon if it is installed in a iOS device.


Solution

  • UI5 has a Device API to get the OS of the browser. If you create a device model as explained in Step 36: Device Adaptation, you should be able to use Expression Binding on the Icons and switch their paths.