So, I got this done. As long with navigator.mozApps.checkInstalled(), I check 
navigator.mozApps.getSelf() for being empty. If it is not null, the app has 
been installed. Still this is always null when I run the checkInstalled() 
function, so I'll just have to use them both. 

08 юли 2013, понеделник, 18:01:59 UTC+3, [email protected] написа:
> I have a mobile version of a website, where I ask Firefox OS users whether 
> they want to install the app on their Firefox OS device. I do the following, 
> which works just fine:
> 
> 
> 
> if (!!(navigator.mozApps && navigator.mozApps.installPackage)) {
> 
> 
> 
>   var manifestFile = location.protocol + '//' + location.host + 
> '/manifest.webapp'
> 
>     , request = window.navigator.mozApps.checkInstalled(manifestFile);
> 
> 
> 
> 
> 
>   request.onsuccess = function() {
> 
> 
> 
>     if (request.result == null) {
> 
> 
> 
> etc...
> 
> 
> 
> This way, when I start the installed Web app, it doesn't any longer ask me 
> for installation, because request.result returns an object, rather than null, 
> which will trigger the installation process.
> 
> 
> 
> So far, so good.
> 
> 
> 
> The problem comes, when I try to install the app from the Firefox Marketplace 
> (the app has been approved). No matter what I do, the request result always 
> returns null and asks the user to install the app again, when it is already 
> installed.
> 
> 
> 
> I can provide more info if necessary.
> 
> 
> 
> Thanks in advance.

_______________________________________________
dev-webapps mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-webapps

Reply via email to