{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/manifest/issues/514","repository_url":"https://api.github.com/repos/w3c/manifest","labels_url":"https://api.github.com/repos/w3c/manifest/issues/514/labels{/name}","comments_url":"https://api.github.com/repos/w3c/manifest/issues/514/comments","events_url":"https://api.github.com/repos/w3c/manifest/issues/514/events","html_url":"https://github.com/w3c/manifest/issues/514","id":186722914,"number":514,"title":"Should appinstalled / beforeinstallprompt fire on native app installation?","user":{"login":"mgiuca","id":228433,"avatar_url":"https://avatars.githubusercontent.com/u/228433?v=3","gravatar_id":"","url":"https://api.github.com/users/mgiuca","html_url":"https://github.com/mgiuca","followers_url":"https://api.github.com/users/mgiuca/followers","following_url":"https://api.github.com/users/mgiuca/following{/other_user}","gists_url":"https://api.github.com/users/mgiuca/gists{/gist_id}","starred_url":"https://api.github.com/users/mgiuca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgiuca/subscriptions","organizations_url":"https://api.github.com/users/mgiuca/orgs","repos_url":"https://api.github.com/users/mgiuca/repos","events_url":"https://api.github.com/users/mgiuca/events{/privacy}","received_events_url":"https://api.github.com/users/mgiuca/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-11-02T06:32:25Z","updated_at":"2016-12-15T23:08:20Z","closed_at":null,"body":"Bit of a thorny issue that came up while implementing `appinstalled` in Chrome.\r\n\r\nBackground:\r\n\r\n* Chrome's implementation of the `beforeinstallprompt` event (currently being specced in #506) fires the event whenever the web app *or* related app install banner is to be shown.\r\n* The `BeforeInstallPromptEvent` object includes a `platforms` field, which lists the platform that the app is being installed for (I'm not sure why, but it is an array that always contains exactly one element). This could be \"web\" for the web app, \"play\" for Google Play (Android) app, etc.\r\n* We decided to punt on including this in the spec, since it is a somewhat Chrome-specific detail.\r\n* The manifest spec includes `related_applications` which lists, for example, Android or iOS equivalents to a web app. But the spec treats these as incidental metadata, and doesn't mention any specific interaction between `related_applications` and app installation events.\r\n* Specifically, the `appinstalled` event, which is already in the spec, is supposed to be fired by **steps to install the web application** (and not when a native application is installed).\r\n\r\nSo the issue for us is that we already have `beforeinstallprompt` firing when a native app banner is shown (despite the current draft language not permitting this), and when I implement `appinstalled`, I have to choose between firing the event on native app installation (despite the spec not permitting this) or not (which would be inconsistent with our implementation `beforeinstallprompt`). I'd prefer to keep consistency, so maybe we should add a provision that installing a related application may fire `beforeinstallprompt` (when the banner is shown), and that it may fire `appinstalled` when it becomes installed. The proposed changes would be (assuming the current `beforeinstallprompt` draft):\r\n\r\n1. Explicitly note steps to notify before installing, and steps to install, a related application, the process of which is triggered at the user-agent's discretion.\r\n2. State that `beforeinstallprompt` is to be fired before notifying the installation of a related application.\r\n3. State that `appinstalled` is to be fired after installation of a related application.\r\n4. Add a `platforms` member to `BeforeInstallPromptEvent`.\r\n5. Add `AppInstalledEvent` interface and change `appinstalled` to be that instead of `Event`.\r\n6. Add a `platforms` member to `AppInstalledEvent`.\r\n\r\n(Note: 2 and 3 imply 4, 5 and 6, because if we fire it on related app install, we need to tell the site that it isn't a web app install.)\r\n\r\nIf we can't change the spec, we would probably honour that in Chrome for `appinstalled`, but I doubt we can remove this from `beforeinstallprompt` (since I think this was the main use case for which we added `beforeinstallprompt` in the first place). So we'd likely just remain diverged, as well as `appinstalled` behaving inconsistently with `beforeinstallprompt`. So I'd like to discuss and hopefully change the spec. @marcoscaceres ?"},"comment":{"url":"https://api.github.com/repos/w3c/manifest/issues/comments/267471448","html_url":"https://github.com/w3c/manifest/issues/514#issuecomment-267471448","issue_url":"https://api.github.com/repos/w3c/manifest/issues/514","id":267471448,"user":{"login":"mgiuca","id":228433,"avatar_url":"https://avatars.githubusercontent.com/u/228433?v=3","gravatar_id":"","url":"https://api.github.com/users/mgiuca","html_url":"https://github.com/mgiuca","followers_url":"https://api.github.com/users/mgiuca/followers","following_url":"https://api.github.com/users/mgiuca/following{/other_user}","gists_url":"https://api.github.com/users/mgiuca/gists{/gist_id}","starred_url":"https://api.github.com/users/mgiuca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgiuca/subscriptions","organizations_url":"https://api.github.com/users/mgiuca/orgs","repos_url":"https://api.github.com/users/mgiuca/repos","events_url":"https://api.github.com/users/mgiuca/events{/privacy}","received_events_url":"https://api.github.com/users/mgiuca/received_events","type":"User","site_admin":false},"created_at":"2016-12-15T23:08:20Z","updated_at":"2016-12-15T23:08:20Z","body":"We are working on that too ([`getInstalledRelatedApps`](https://github.com/WICG/get-installed-related-apps)), but I think it also makes sense to have these come up as events when they are installed."}}
{"actor":{"display_login":"mgiuca"}}