Pancake/French Toast/Message API: Difference between revisions
(Added proposed solutions) |
(Added note on SOA) |
||
Line 1: | Line 1: | ||
=== User stories === | |||
==== As a front-end developer, I need a way to tell the native app to open a new layer containing a specific layer state. ==== | ==== As a front-end developer, I need a way to tell the native app to open a new layer containing a specific layer state. ==== | ||
Line 37: | Line 39: | ||
''Can we confirm that the same localStorage is available between UIWebViews'' - [[Gbrander]] | ''Can we confirm that the same localStorage is available between UIWebViews'' - [[Gbrander]] | ||
=== Discussion === | |||
''I don't think we need a general message mechanism to talk to the app. I also don't think we need to be able to send messages to specific layers from specific layers. In general, I would like to make the coupling between layers loose, and based on requesting URLs be opened. The layer itself can decide what to do with the URL.'' -[[Gbrander]] |
Revision as of 18:30, 31 August 2012
User stories
As a front-end developer, I need a way to tell the native app to open a new layer containing a specific layer state.
FrenchToast.openApplicationView(url)
As a front-end developer, I need a way to tell the native app to open a URL in the viewer.
FrenchToast.openPublicView(url)
I don't think we need the name parameter. I don't think we want layers to be able to talk directly to each other. Instead, I believe we can stick to a service-oriented architecture based on URLs. -Gbrander
As a front-end developer, I need the app to tell me when a layer has received focus so that I can check for updates and refresh data if necessary.
What about a DOM event?
window.addEventListener('layerFocus', fn)
As a front-end developer, I need a way to securely verify that the user is authenticated so that I do not expose confidential information.
// find out if the current session is valid FrenchToast.getSession() // to start browserid FrenchToast.startBrowserId(callback) // to validate the browserid token FrenchToast.validateBrowserIdReceipt(receipt, callback)
Can somebody who worked on the session stuff in the past verify that these could satisfy the user story? - Gbrander
Use standard localStorage to serialize/deserialize persisted app data.
window.localStorage JSON.stringify JSON.parse
Can we confirm that the same localStorage is available between UIWebViews - Gbrander
Discussion
I don't think we need a general message mechanism to talk to the app. I also don't think we need to be able to send messages to specific layers from specific layers. In general, I would like to make the coupling between layers loose, and based on requesting URLs be opened. The layer itself can decide what to do with the URL. -Gbrander