Hello colleagues,
Could you please clarify a proper way to set the favicon.ico of the application? Let's assume that it's hosted as a standalone application on the SCP.
I see three ways to do it:
1) Set it via manifest.json file. This either doesn't work or I don't understand how to use this:
"sap.ui": {
"technology": "UI5",
"icons": {
"icon": "",
"favIcon": "img/favicon.ico",
"phone": "",
"phone@2": "",
"tablet": "",
"tablet@2": ""
},
2) Set favicon via Shell object in index.html file - working fine:
new sap.m.Shell({
homeIcon: {
favicon: "img/favicon.ico"
},
app: new sap.ui.core.ComponentContainer({
height: "100%",
name: ""
})
}).placeAt("content");
3) Set via image/x-icon link in index.html - working fine:
<link href="img/favicon.ico" rel="shortcut icon" type="image/x-icon" />
Thanks,
Ilya
As far as I understand it, the entry in the manifest.json is not meant to automatically show that icon, but it is an information for a surrounding launcher what icon _could_ be used to represent that app.
The framework code that instantiates components (sap.ui.component) does not know how created components will be shown to the user or whether the currently created component qualifies as "_the current application_" or only as a helper (reuse component). Such a decision is left to the launcher.
Fiori Launch Pad (FLP) for example reads the entry from the manifest of the currently active application and - when not empty - sets it with a call
jQuery.sap.setIcons({
'phone': '',
'phone@2': '',
'tablet': '',
'tablet@2': '',
'favicon': oFavIcon,
'precomposed': true
});
I'm not aware of any code in the OpenUI5 repository that would do this automatically for a standalone app. Whether the Shell control would be in a position to take that decision, I can't judge. In the context of the FLP for example, the shell control is one layer deeper than the launcher, but that might not be a valid argument.
Same is discussed here - https://blogs.sap.com/2017/01/08/complete-the-branding-of-your-ui5-apps-with-a-favicon/
The settings in the manifest.json are for FLP - https://help.sap.com/saphelp_uiaddon10/helpdata/en/d4/09e4c8940743ccb173e9ee8bbaa3a8/frameset.htm
I am forwarding internally the issue for reference with #1870229007
Additionally to codewarriors comment ...
The favIcon can also be set using the Mobile utils module. You can find the details here:
Mobile.setIcons()
@stephania87 Could this issue be reopened?
I think the attribute sap.ui/icons should be either hidden completely from OpenUI5 documentation _Descriptor for Applications, Components, and Libraries_ (since it only applies to apps launched from FLP), or the attribute should be supported for stand-alone apps as well. Otherwise, it's confusing.
Most helpful comment
@stephania87 Could this issue be reopened?
I think the attribute
sap.ui/iconsshould be either hidden completely from OpenUI5 documentation _Descriptor for Applications, Components, and Libraries_ (since it only applies to apps launched from FLP), or the attribute should be supported for stand-alone apps as well. Otherwise, it's confusing.