I've been trying to implement the getInstalledRelatedApps API to work into my project in a smartbanner using jquery.smartbanner.js, but the relatedApps const as shown below is returning empty, and the state of the promise is always in "pending". A screenshot of the promise is attached below:
(async function () {
alert("running");
const relatedApps = await navigator.getInstalledRelatedApps();
alert(relatedApps);
console.log(relatedApps);
relatedApps.forEach((app) => {
console.log(app.id, app.platform, app.url);
});
})();
The manifest.json is as:
{
"name": "Example",
"short_name": "Example",
"lang": "en-US",
"theme_color": "#192c4f",
"background_color": "#192c4f",
"display": "standalone",
"scope": "/",
"start_url": "/",
"icons": [
{
"src": "images/36.png",
"sizes": "36x36",
"type": "image/png"
},
{
"src": "images/48.png",
"sizes": "48x48",
"type": "image/png"
},
{
"src": "images/72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "images/96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "images/144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "images/192.png",
"sizes": "192x192",
"type": "image/png"
}
],
"splash_pages": null,
"prefer_related_applications": true,
"related_applications": [{
"platform": "play",
"id": "com.example.android"
}]
}
The playstore app ID has been doublechecked from the android app side. any help would be appreciated, thanks!