On Wed, Nov 7, 2012 at 6:09 PM, Yusuke YAMAMOTO <[email protected]> wrote: > Hi all, > > We want to know "all" about of how to launch "other" apps. > We know that there are four types of launch method as below. > So if our recognition are wrong( or not enough) could you point out of that. > > 1.WebActivities API, SystemMessage API > 2.<a href=…> > 3.document.location.href > 4.window.open()
The following ways are the ways that an app can be launched: 1. App.launch() 2. WebActivities 3. System messages 4. <iframe mozapp> However there are important limitations on all of them. I'll take them in reverse order. First off, 4 is only available to the "system app". I.e. basically only Firefox OS itself can use this method for launching apps. This is basically the low-level primitive that is used any time an app is launched. For 3, system messages is generally not something that a normal app can initiate to launch another app. System messages are generally only fired in response to things like incoming SMS messages or phone calls, alarms that the app itself has scheduled, etc. We will surely add more system messages in the future (such as Push API, a system message for when the user gets data connection or mobile connection). Technically all different types of system messages should likely be enumerated in the table above. In fact, WebActivities use system messages to launch the app which was selected by the user. So number 2, WebActivities, is basically just a special case of number 3. However since you were asking about apps launching each other it seems important enough to point out separately. WebActivities can be used by one app to launch another app. However the restriction is that the app doesn't have direct control over choosing which app is launched. If there are several apps installed which implements a given activity the user is in charge of choosing which one is launched and the app has no control over this. And finally, App.launch() can only be used to launch applications which an app can get a reference to. I.e. app A can only use app.launch() to launch app B if app A can get a reference to the App object for app B. This only happens in three cases: 1. A and B are coming from the same origin. This isn't possible in Firefox OS v1 since we have a one-app-per-origin restriction. Though this might change in the future. 2. App B was installed from app A. Most commonly app A is an appstore which the user used to install app B. 3. App A has a special privilege which allows it to enumerate all installed apps. So far we're only permitting this for built-in apps. I hope that answers your question. / Jonas _______________________________________________ dev-b2g mailing list [email protected] https://lists.mozilla.org/listinfo/dev-b2g
