I'm not sure a web activity is the implementation you're looking for here.

Dealing with Oauth flows is a bit tricky right now due to how the system app 
intercepts window.open/window.close. The best thing to do is to look at our 
Facebook implementation inside of the communications app. I don't remember all 
of the details, but it works something like:

1 - Create an Iframe to a local HTML file which redirects to the Oauth provider.
2 - When the Oauth provider redirects back to your iframe, use postMessage to 
notify the parent.
3 - The parent window can then close the iframe.

Best,
Kevin Grandon

----- Original Message -----
From: "Paul Theriault" <[email protected]>
To: "Flaki" <[email protected]>
Cc: [email protected]
Sent: Wednesday, April 10, 2013 6:38:41 AM
Subject: Re: [b2g] WebActivities - launching an app from Firefox OS browser

Ah ok, sorry I misunderstood. Can you use a popup window in your app instead of 
switching to the browser proper? I.E. Are you aware that there is a difference 
between calling window.open(...,'_blank') and just window.open() in Firefox OS? 
 In Firefox OS Apps, calls to window.open(...,'_blank') get translated into web 
activity which opens in  the browser app. Calls to window.open() create a 
system provided window which overlays the app, instead of opening the browser 
app proper. I believe the main purpose of this feature is to support oAuth 
style flows. Closing this window then shows the app again. Maybe this suits 
your purposes?

If not, then I am not sure. In theory you could have your app handle a web 
activity, and start that activity from a web page. But there is no way to 
guarantee that your app will be the one which handles the web activity (if more 
than one app is registered as a web activity handler, the user if prompted to 
choose which app they want to open)

- Paul

On Apr 10, 2013, at 12:41 PM, Flaki wrote:

> Thanks for the reply, but I see that I forgot to mention: this is an 
> installed /packaged/ app, not a hosted one, so launching it via a URL is not 
> an option.
> _______________________________________________
> dev-b2g mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-b2g

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

Reply via email to