Changes

Jump to: navigation, search

CloudServices/Presence

5,890 bytes removed, 01:07, 17 December 2013
no edit summary
=''Presence''=
==Service Overview==
Presence is a proposed Cloud Service that tracks a Firefox OS device's Internet connectivity status as ''online'', ''offline'' or ''unavailable'' by the device's Firefox Account. A Firefox OS Web App may request permission on behalf of its publisher to read status. Once approved, the publisher may poll the Presence service and, once the device is back online, push messages to the Web App.
Presence is conceived and proposed by the Cloud Services team's [https://phonebook.mozilla.org/#search/tarek Tarek Ziade] for [[Firefox OS]].==Project Contacts==
''Principal Point of Contact'User Stories'- <i>Tarek Ziade</i> <i>tziade@mozilla.com</i>'' ("As a Point of Contact''customer- <i>Ben Bangert</i> <i>bbangert@mozilla.com</i>'' I want Project Manager''feature'' so I can - <i>Robert Lord</i> <i>rlord@mozilla.com</i>''benefitFireFoxOS''- <i>Fabrice Desré</i> <i>fabrice@mozilla.")com</i>
* As a user of Web Apps ("apps") on Firefox OS, I want to share my presence with publishers to receive timely notifications from my apps so I don't miss time-sensitize things. * As a user of Web Apps ("apps") on Firefox OS, I want to share my presence with publishers to receive notifications from any and all of my apps including those not running because many of my favorite apps continually update from the Internet. * As a publisher of Web Apps on Firefox OS, I want to read a user's presence status to avoid maintaining a battery draining background process. * As a publisher of Web Apps on Firefox OS, I want to read a userIRC's presence status to avoid running my own service tracking users' - #<i>presence. -wg</i>''Group Email'FirefoxOS Team Contacts'''  [- https://phonebookmail.mozilla.org/#searchlistinfo/fabrice Fabrice Desré]wg-presence
==Presence on other Mobile Platforms==
XXX stuff to dig: can we use CSS with BOSH or with websockets
 
==Architectural Overview==
 
There are two levels of presence:
 
1/ app-level presence
 
* online: you are connected in the app, and using it
* offline: you are disconnected from the app
 
2/ device-level presence.
 
* online : you are using your FXOS phone or your desktop browser
* offline: you are not on your FXOS phone or your browser
 
Sometimes you might be online in 1/ or 2/ and not wishing other users to know about it. And you also might want to appear online for app B but not for app C.
 
1/ is solved by every application. they all have their ad-hoc system, their social graph, rosters, contacts, etc. Large social networks don't care as much about 2/ because they would prefer you to use *only* their application for talking to your friends. By solving 2/, we can enable non-dominant social/communication applications to get useful presence information they can act on.
 
Mozilla Presence acts as a <b>trusted intermediary between the user's device (solving 2/) and the applications the user has allowed to see their presence, as well as a short-lived notification system for applications to engage available users</b>.
 
[[File:PresenceOverview.jpg]]
 
Channel communication overview:
 
[[File:MPChannels.jpg]]
 
==Project Contacts==
''Principal Point of Contact'' - <i>Tarek Ziadé</i> <i>tarek@mozilla.com</i>
 
''IRC'' - #<i>presence-wg</i>
 
''Mailing list'' - [https://mail.mozilla.org/listinfo/wg-presence https://mail.mozilla.org/pipermail/wg-presence/] - wg-presence@mozilla.org
==Goals==
The project will be a success if an application registered with Mozilla Cloud Services is able to reach out to users that are "online" (active on their phone or desktop but with the app not running) via Mozilla Presence.
 
== Terminology ==
 
;AppDeveloper : A developer that creates applications which may or may not have server-backed resources.
 
;AppService : An Internet-accessible server that an application talks to. For example, Facebook's locally installed application talks to Facebook's API server to get data. The Facebook API server in that case is the AppService as it acts as a service to the application.
 
;Application : A website application that might run locally on a device with or without needing to talk to an AppService.
 
;FxAID : A Firefox Accounts user ID.
 
;Device Presence Channel : A channel of communications between a phone/browser device and Mozilla Presence that carries live notifications from Presence and presence data to Presence.
 
;AppService Presence Channel : A channel of communication between Mozilla Presence and an AppService that carries presence updates for users sharing their presence with the AppService and live notifications from the AppService to be delivered to a PUID.
 
; LiveNotification : A live notification is an alert requiring a response within a set period of time (5 seconds up to several minutes) before its considered 'missed' and stored on the device separately to indicate it can no longer be acknowledged. A response is considered acknowledgement and switches the user to the appropriate application to act on the LiveNotification.
 
; Presence : For our purposes the definition of presence definined by XMPP also applies, but in our case 'contacts' happen to be AppServices that the presence is broadcast to. See http://xmpp.org/rfcs/rfc6121.html#presence-fundamentals
 
;PUID : A Presence Unique Identifier. Every AppService authorized by a user to see presence updates will be assigned a PUID that it should store and associate with the user (who may or may not be logged into the application).
==Use Cases==
See [https://wiki.mozilla.org/CloudServices/Presence/UseCases Detailed Use Cases].
=== Chat Room (=IRC Channel) =FAQ==
A chat room app let To help people talk with each other on the same web page. You connect get up to the system using Persona speed faster and you avatar appears on the page to other users. You can add contacts in that appprevent backtracking, commonly asked questions by those getting involved are listed here with an answer.
People see you messages in realtime. It's built using whatever chat technology (BOSH/=== Is this going to use XMPP, plain websockets)? ===
Before The presence channel to AppServices will have an XMPP option. It's useful to remember that Mozilla Presence:is in very early stages at this moment. Worrying about the exact implementation is a detail that we're not addressing yet as we build some prototypes to test ideas out and prove the overall concept is worthwhile.
* a user appears as present (or busy or idling etc..) in the chat room when she=== Shouldn's connected to the app and uses it* t Mozilla have a user that is not currently using the app (perhaps because FFOS killed that app due to constrained device resouces) appears offline. * if the application wants way for me to reach an offline user, it does not really know if the user is offline at the device level or just the app level.see my contacts online? ===
With Nowadays, peoples' personal connections are spread across multiple online services (Facebook, Google+, Skype, etc). These services usually already have done the work of ensuring both people want to see each other's presence and have ways to facilitate a conversation. All they need is a way to be aware of a users presence when their app might be closed or suspended (on a phone). By serving as the underlying plumbing notifying AppService's when users are online, Mozilla Presenceavoids having to try and change users expectations about where their 'friends' are and can facilitate new social interaction applications that need presence data.
* a user runs the Presence service and let it know when he's offline/online at the device level (desktop browser: a social API sidebar, FXOS: some background service)==Requirements==* the user set permissions: "yes the chat app can get my presence updates"* the user then can use the chat app independantly from the presence thing - or not having it running at some point at all* the chat app interacts with the presence server: it gets a stream <i>List of presence update from the presence server only if the user authorized it and status messages if set* the chat app can notify a user that another user pinged him in the roomrequirements</i>
Resources:==Get Involved==
* '''Demo''' (without the app permission dance yet): https://vimeo.com/79394330
* '''Prototype repo''' https://github.com/mozilla-services/presence-chatroom
== Documents so far ==
[https://etherpad.mozilla.org/ServicesPresence Services Presence Etherpad]
[https://id.etherpad.mozilla.org/presence Identity Presence Etherpad]
=== Live Support =Meetings ==We try to meet every Thursday at 10:00 Pacific Time
For mozilla employees, we meet in the "Services" vidyo room, and use IRC channel #presence-wg (This is about a tentative and unnamed Firefox OS support toolirc.mozilla.org)
Maria is a Mozillian who wants to helpful to other Firefox OS users. She signs up with a support application For participants outside of mozilla, you can call into the meeting using the following numbers:* Phone (US/Intl): 650 903 0800 x92 Conf: 98616#* Phone (Toronto): 416 848 3114 x92 Conf: 98616#* Phone (US): 800 707 2533 (an application that Mozilla createspin 369). She indicates what she knows about, and what languages she speaks.Conf: 98616#
Javier wants to activate developer mode on his phone, but can't find the right setting. He goes into Please mute yourself with '* 1''Help &gt; Live Support'''. The phone sends a request to the support app: someone wants support with Settings in es-MX. The application looks in its database of contributors to see who has the appropriate expertise (and language) upon joining to help him, prevent needless noise and who is onlinefeedback. Among the pool of possible people it selects Maria, and pings her to see if she You can provide support. If she doesnunmute yourself with '* 1't respond then another person is selected from the pool (or maybe many people are asked at once), and if someone else helps Javier then Maria is notified that her help is no longer neededagain to speak.
Note that Maria would be participating under an alias specific to the support application (though not anonymous), and she will not be fielding support requests all the time (e.g., she may not provide support at work, only after hours).=== Meeting Notes ===
[[Services/Roadmaps/Presence/Meetings/notes_20131014]]
=== Facebook ===[[Services/Roadmaps/Presence/Meetings/notes_20131031]]
Jeff wants to appear online on Facebook (he's already determined on Facebook who can see him, etc)https://etherpad.mozilla.org/presence-2013-11-26
He's already installed the Facebook app on his FFOS phone, he goes to the Settings and touch, "Authorize Presence",his screen loads a doorhanger (provided by Mozilla Presence) asking if he wants to authorize the app.=Design=
Jeff clicks "Yes" on the doorhanger page, and the Facebook app waits while Facebook recieves the redirect, storeshis UID, and closes the doorhanger (and likely needs to do something else to register this with the device so thatit will appear in the Presence Settings page).==Points of Contact==
The next day, Jeff wakes up, and goes to check his e-mail on his phone. Upon seeing his idle drop, the phone'ssimple-push client (which is always running) includes an 'O' in its next PING to simplepush to indicate the useris now online. Mozilla Presence gets notified of this and acts on it to batch the status change to Facebook. Thebatch of updates goes to Facebook including Jeff's, so Facebook knows that Jeff is now online, and updates itsdatabase indicating this.Services Engineers:
Jeff's friend Marsha goes to Facebook to see if any of her friends are online* <i>Ben Bangert</i> <i>bbangert@mozilla. Marsha sees that Jeff is now onlinecom</i>and sends a chat request* <i>Tarek Ziadé</i> <i>tarek@mozilla. Facebook uses SimplePush to notify Jeff of the chat request. Jeff sees the chat requestcom</i>
=== AppMaker ===Repository: https://github.com/mozilla-services/presenceDiagrams: https://github.com/mozilla-services/presence-graffles
''similar to Live Support''==Architecture Overview==
Sue has signed up to be an appmaker tutor -- Bob is a new appmaker teacher, and is stuck in a workshop, Bob wants to know which There are two levels of the tutors are available to help w/ a togetherJS sessionpresence:
Sue is an appmaker expert. She previously authorized AppMaker to see her Online Presence 1/ app- as Jeff did in with Facebook in the previous story. She also configured her notifications so any message coming from AppMaker when she's online would display a message on her screen and let her start the app.level presence
Bob is building a cool new application with his class * online: you are connected in AppMaker the app, and would like some input from someone. Appmaker maintains a mapping of which helpers using it * offline: you are appropriate for which users (e.g. by language skills). He's currently working in AppMaker disconnected from his FFOS Phone and sees that Sue is online.the app
Bob clicks on Sue's name in his contact lists and hit "invite Sue for peer design session". AppMaker sends a notification to Sue using the Simple Push service2/ device-level presence.
Sues gets the notification instantly * online : you are using your FXOS phone or your desktop browser* offline: you are not on her your FXOS phone via her simple-push client and joins Bob on the design page.or your browser
AppMaker uses TogetherSometimes you might be online in 1/ or 2/ and not wishing other users to know about it.js so Bob and Sue can interact live on the pageAnd you also might want to appear online for app B but not for app C.
=== Wikipedia ===1/ is solved by every application. they all have their ad-hoc system, their social graph, rosters, contacts, etc. Large social networks don't care as much about 2/ because they would prefer you to use *only* their application for talking to your friends. By solving 2/, we can enable non-dominant social/communication applications to get useful presence information they can act on.
Mozilla Presence acts as a <b>trusted intermediary between the user's device (This comes from conversations about TogetherJS solving 2/) and Wikipedia)the applications the user has allowed to see their presence, as well as a short-lived notification system for applications to engage available users</b>.
''similar to Live Support''[[File:PresenceOverview.jpg]]
Some questions that might be nice to answer with a presence serviceChannel communication overview:
* Is there someone actively working on this page (or its related Talk/etc pages) right now?* Is there someone ready to offer X help at this moment? (X examples[[File: editing help, template authoring, mediate disputes)* Given a community of interest (people interested in baseball, admins, etc):** Who is around?** What are they doing? (E.g., editing pages, hanging out in a discussion, etc; each person would opt in to publicizing this information to other peopleMPChannels.)jpg]]
== Terminology ==
=== Chatspace ===;AppDeveloper : A developer that creates applications which may or may not have server-backed resources.
Jen ;AppService : An Internet-accessible server that an application talks to. For example, Facebook's locally installed application talks to Facebook's API server to get data. The Facebook API server in that case is building https://githubthe AppService as it acts as a service to the application.com/mozilla/chatspaces - we should investigate how presence fits there
==FAQ==;Application : A website application that might run locally on a device with or without needing to talk to an AppService.
To help people get up to speed faster and prevent backtracking, commonly asked questions by those getting involved are listed here with an answer;FxAID : A Firefox Accounts user ID.
=== Is this going ;Device Presence Channel : A channel of communications between a phone/browser device and Mozilla Presence that carries live notifications from Presence and presence data to use XMPP? ===Presence.
The presence ;AppService Presence Channel : A channel to AppServices will have of communication between Mozilla Presence and an XMPP option. It's useful to remember AppService that Mozilla Presence is in very early stages at this moment. Worrying about carries presence updates for users sharing their presence with the exact implementation is a detail that we're not addressing yet as we build some prototypes to test ideas out AppService and prove live notifications from the overall concept is worthwhileAppService to be delivered to a PUID.
=== Shouldn; LiveNotification : A live notification is an alert requiring a response within a set period of time (5 seconds up to several minutes) before its considered 't Mozilla have a way for me missed' and stored on the device separately to indicate it can no longer be acknowledged. A response is considered acknowledgement and switches the user to the appropriate application to see my contacts online? ===act on the LiveNotification.
Nowadays, peoples' personal connections are spread across multiple online services (Facebook, Google+, Skype, etc). These services usually already have done ; Presence : For our purposes the work of ensuring both people want to see each other's presence and have ways to facilitate a conversation. All they need is a way to be aware definition of a users presence when their app might be closed or suspended (on a phone). By serving as the underlying plumbing notifying AppService's when users are onlinedefinined by XMPP also applies, Mozilla Presence avoids having to try and change users expectations about where their but in our case 'friendscontacts' are and can facilitate new social interaction applications happen to be AppServices that need the presence datais broadcast to.See http://xmpp.org/rfcs/rfc6121.html#presence-fundamentals
==Requirements==* <i>List of requirements</i>;PUID : A Presence Unique Identifier. Every AppService authorized by a user to see presence updates will be assigned a PUID that it should store and associate with the user (who may or may not be logged into the application).
==Get InvolvedRoadMap==
===Prototype===
== Documents so far ==[httpsServer-side implementation://etherpad.mozilla.org/ServicesPresence Services Presence Etherpad]
[https://id.etherpad.mozilla.org/* Allows AppServices to send LiveNotifications* Sends AppServices presence Identity Presence Etherpad]stanzas* Holds WebSocket connection to devices* Sends LiveNotifications to devices* Allows a device when connecting to toggle what AppServices should have presence stanzas relayed
== Meetings ==We try to meet every Thursday at 10Client-side implementation:00 Pacific Time
For mozilla employees, we meet in the "Services" vidyo room, and * Settings screen to manage** Applications that can use IRC channel #presencePresence (On/Off toggles)** Online - Away -wg Offline sliders to set how much idle is away vs. offline** Custom status message** Custom away message (irc.mozilla.orgif additional info should accompany it)* LiveNotifications pop-up with Accept/Dismiss button* Background service that sends pings, accepts LiveNotifications
For participants outside of mozilla, you can call into the meeting using the following numbers:* Phone (US/Intl): 650 903 0800 x92 Conf: 98616#* Phone (Toronto): 416 848 3114 x92 Conf: 98616#* Phone (US): 800 707 2533 (pin 369) Conf: 98616# ===Production V.1===
Please mute yourself with '* 1' upon joining to prevent needless noise and feedback. You can unmute yourself with '* 1' again to speak. Everything in the Prototype, designed for scale, in addition:
=== Meeting Notes ===* Possibly a QUIC-derived UDP-based device-presence channel* FxA Integration for device user (Requires https://wiki.mozilla.org/Identity/Firefox_Accounts/SSO)* Developer Registration page to acquire Presence Application ID, linked to from the Developer page in Marketplace
[[Services/Roadmaps/Presence/Meetings/notes_20131014]]
[[Services== API Reference/Roadmaps/Presence/Meetings/notes_20131031]]Documentation ==
httpsThe Presence service has several functions://etherpad.mozilla.org/presence-2013-11-26
=Design=# let a user update her online status and set a custom status message # let a developer register an application==Points of Contact==# let a user manage applications access to their presence# let an application receive status updates# let an application send a live notification and a user receive it.
Services Engineers:=== 1. Device Channel to Mozilla Presence ===
* <i>Ben Bangert<Mozilla Presence provides a web socket endpoint at '''ws:/i> <i>bbangert@/presence.services.mozilla.com</i>presence''' for* <i>Tarek Ziadé</i> <i>tarek@mozilladevices to connect to.com</i>
Repository: https://githubThe user may connect to the socket using a valid FxA (which will entail a BrowserID Assertion per FxaSSO), and send status updates. The data must be sent in JSON.com/mozilla-services/presence
== General Overview ==Mozilla Presence does not retain a list of applications authorized to see updates, thisdata is kept only on the phone. As a result, the device must indicate what application ID'spresence data should be sent to when connecting. This is done in a application stanza, and canbe sent during a connection if a user is changing what applications can see the status as well.
The Presence service has several functionsExample:
# let a user update her online status # let a developer register an application# let a user manages applications permissions# let an application receive status updates# let an application send a live notification and a user receive it. === 1. Online status updates === Mozilla Presence provides a web socket endpoint at {'type': 'ws://presence.services.mozilla.com/presenceappvisibility', 'application_idsThe user may connect to the socket using a valid Persona assertion: [421, 492, 9592, and send status updates. The data must be sent in JSON.391]}
Status updates
Example:
Mozilla Presence provides a web page at '''https://presence.mozilla.com/myapps'''
where an application developer can connect by logging in with her persona account.
Once logged in, the developer can fill a
The redirect flow looks like this:
[[File:WPAuthInteraction.jpg]]
 
=== 4. Presence Sidebar ===
 
XXX the one risk we have prototyping with Social Sidebar is that we design something that works great for desktop use, but is not a good UX for a phone
 
Mozilla Presence provides a Social API sidebar with the following features:
 
* a Persona login/logout button
* three buttons to set her status. [online/offline/unavailable].
* a list of authorised applications with a [deactivate/revoke] button for each one of them.
 
This sidebar can be activated by the user to manage her presence - the side bar
will open a web socket on ws://presence.services.mozilla.com/presence to send
status updates.
=== 5. Status updates ===
The application has no feedback on whether a notification was seen by the user.
 
XXX implementation of desktop UI, see https://developer.mozilla.org/en-US/docs/Social_API/Widgets#Notification_Panels
==Platform Requirements==
Confirm
192
edits

Navigation menu