On Tuesday, June 19, 2012, Anant Narayanan wrote: > On 06/18/2012 06:51 PM, Jonas Sicking wrote: > >> Please let's not create APIs which have different meanings depending on >> if the caller is privileged or not. That's just confusing to developers >> and to us. And makes future extensions to such APIs even more tricky. >> >> IMHO: >> * getInstalled() should *always* just returned the list of apps >> installed by the current origin. >> * mgmt.getAll() should not be callable from non-privileged callers, and >> for privileged callers should return any launchable app. (My >> understanding is that only "natively installed" apps are launchable?) >> * mgmt.getAllSynced() or some such should return any app which is in the >> registry but is not launchable >> >> Would this satisfy all requirements? >> > > Yes, I believe it would, though I would propose a tiny tweak: > - Keep all existing functions as they behave today. > - Add mgmt.getAllInstalled() to return only the set of apps that are > installed and launchable. > > Only reason being, I want to avoid the word "synced", as the API is > potentially useful even without sync functionality if we go by the idea > that the DOM registry contains all acquired apps and not just installed > apps. > > Does this sound reasonable to everyone? >
I'd like to avoid having .getInstalled()/.mgmt.getAll()/.getSelf() return App objects representing an app instance which can't be launched. The fact that Firefox will have App objects which can't be launched seems like an implementation quirk and not something that we should expose to the web or expect other parties to want to standardize. I'm even hoping that Firefox will get to the point where we don't have such apps either. For example by automatically starting to install apps when they are synced (in which case the App object would indicate the installation status). That's not something we need to figure out for now though. My point is that I think that our non-native-installed apps is an implementation quirk that we should keep out best we can for now. I'm happy to use some other name than getAllSynced() though. Like getAllNonInstalled() or getAllInstallPending(). Do we additionally need an API which lets the a privileged app natively >> install an app which has been synced but is not natively installed yet? >> It seems fairly useless to users if all we can do is to tauntingly >> display app icons for apps which have been synced but can't be launched >> because they are not natively installed. Or are we just going to grab a >> link to the store from the app and then ask the user to re-install the >> app? >> > > I think the UA can optimize this step, since it knows which apps the user > has previously acquired, a call to install() for any of those apps can > bypass the doorhanger (we can decide whether to restrict to privileged > domains only), but no change to the API is necessary. > Ok, so we are expecting user's to go to the store an installed the app from there? We'd just make that flow nicer by being able to link them directly to the relevant page in the store, and not having to prompt the user again? Also, the dashboard is expected not to display the app icons for apps that > are not installed in the same manner as those which are. In our dashboard, > at-least, there will be a clear demarcation and such apps will displayed in > a "not on this device" tab much like the iOS store. The user can choose to > install any of them on their current device if necessary, but there were no > plans to allow seamless launching of these apps. Sounds like having a separate functions for returning just the set of apps which have been fully installed (in my proposal mgmt.getAll()) and returning just the set of apps which are not natively installed (in my proposal mgmt.getAllSynced/getAllNonInstalled/getAllInstallPending) would work great for such a UI. / Jonas _______________________________________________ dev-webapps mailing list [email protected] https://lists.mozilla.org/listinfo/dev-webapps
