Closed Bug 819175 Opened 12 years ago Closed 11 years ago

Document app manifest property messages on MDN

Categories

(Marketplace Graveyard :: Developer Pages, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jsmith, Assigned: markg)

References

(Blocks 1 open bug)

Details

(Whiteboard: p=1)

FF OS currently supports the app manifest property messages for app developers. However, our app manifest documentation currently does not call out support for it. Let's update our docs.
My notes on messages:

messages specifies a mapping of a system message to web content to render. Here's an example from the comms app:

  "messages": [
     { "telephony-new-call": "/dialer/index.html#keyboard-view" },
     { "bluetooth-dialer-command": "/dialer/index.html#keyboard-view" },
     { "headset-button": "/dialer/index.html#keyboard-view" },
     { "notification": "/dialer/index.html#keyboard-view" },
     { "alarm": "/facebook/fb_sync.html" }
  ]

Fabrice probably can add more information on this.
Is there a full list of these system messages and what they do somewhere? Like these one form comment 1:

telephony-new-call
bluetooth-dialer-command
headset-button
notification
alarm
Assignee: nobody → m1879
Can you give us a status update of this bug?
Priority: -- → P2
Whiteboard: p=1
Just a quick note - this is a third-party app manifest property we support, so this is still needed to be documented.

The two pieces necessary are:

1. Documenting what the messages property is
2. Documenting the Gaia messages already supported

I believe the general concept of messages is indicating in your app manifest what messages you are allowing this app to capture. So if you call out "alarm" in your messages property, then you are allowing the app to call set a message handler through mozSetMessageHandler to capture that message so long as the app type as the ability to capture that message. If the app manifest property isn't specified or it's specified, but the app type doesn't have permissions to get that message, then the message won't be able to be captured by the app in mozSetMessageHandler.

For messages we already support, that's best found by looking at the manifest.webapp files in the Gaia source for each app.
The "messages" manifest property does not appear in the .jsm that enumerates the manifest properties:

https://mxr.mozilla.org/mozilla-central/source/dom/apps/src/PermissionsTable.jsm

jsmith, fabrice, are there manifest properties that come from somewhere else?
(In reply to Mark Giffin from comment #5)
> The "messages" manifest property does not appear in the .jsm that enumerates
> the manifest properties:

That's the permission table - not really a relevant point for grabbing what manifest properties we support.

> 
> https://mxr.mozilla.org/mozilla-central/source/dom/apps/src/PermissionsTable.
> jsm
> 
> jsmith, fabrice, are there manifest properties that come from somewhere else?

Fabrice will have to answer this one.
The list of system messages we support is there:
https://mxr.mozilla.org/mozilla-central/source/dom/messages/SystemMessagePermissionsChecker.jsm#29

For each message, the application may need to have some permissions access. For instance, to receive the "sms-received" system message, the application needs to have the "sms" permission. Some messages don't require any permissionm like the "activity" one.
So I will just assume that a manifest property called "messages" exists and document it. But I have been using PermissionsTable.jsm to tell what manifest properties are supported. Besides messages, are there other manifest properties that are missing from this page:

https://developer.mozilla.org/en-US/docs/Apps/App_permissions
(In reply to Mark Giffin from comment #8)
> So I will just assume that a manifest property called "messages" exists and
> document it. But I have been using PermissionsTable.jsm to tell what
> manifest properties are supported. Besides messages, are there other
> manifest properties that are missing from this page:
> 
> https://developer.mozilla.org/en-US/docs/Apps/App_permissions

That's referring to the app perms page, which is slightly different than general app manifest properties, which are here - https://developer.mozilla.org/en-US/docs/Apps/Manifest. Messages is the only one I know of that's left that we would expose to a third-party app developer. There's others that exist still, but they are only allowed within Gaia itself.
Is the message manifest property Firefox OS-only?
(In reply to Mark Giffin from comment #10)
> Is the message manifest property Firefox OS-only?

For now, yes.
Mark I think finished this recently - I see the doc updated to include this property.

https://developer.mozilla.org/en-US/docs/Apps/Manifest#messages
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
(In reply to Jason Smith [:jsmith] from comment #12)
> Mark I think finished this recently - I see the doc updated to include this
> property.
> 
> https://developer.mozilla.org/en-US/docs/Apps/Manifest#messages

Yes I added messages to that doc. But I was waiting for a response to an email from Mar 13. I'll ask here. I collected all the messages I could find in the Gaia apps code in github, see below. Should I put these in the documentation?

alarm
bluetooth-authorize
bluetooth-cancel
bluetooth-dialer-command
bluetooth-hfp-status-changed
bluetooth-opp-receiving-file-confirmation
bluetooth-opp-transfer-complete
bluetooth-opp-transfer-start
bluetooth-opp-update-progress
bluetooth-pairedstatuschanged
bluetooth-requestconfirmation
bluetooth-requestpasskey
bluetooth-requestpincode
headset-button
icc-stkcommand
notification
sms-received
sms-sent
telephony-call-ended
telephony-new-call
ussd-received
Keywords: dev-doc-needed
Hmm...I'm wondering if we should break out the "preconfigured" messages for B2G into a separate doc you reference from the App Manifest Doc. Speaking of which, we should consider doing something similar with Gaia Web Activities vs. the Web Activities API.

Maybe we should put that information under the Firefox OS documentation tree?

Sheppy - What do you think?
Flags: needinfo?(eshepherd)
(In reply to Jason Smith [:jsmith] from comment #14)
> Hmm...I'm wondering if we should break out the "preconfigured" messages for
> B2G into a separate doc you reference from the App Manifest Doc.

If my list above is the "preconfigured" messages, I agree. I was definitely going to break out these permissions into a separate doc from the main manifest doc, and link to it from the manifest page. If they are b2g-only, they should be with the FxOS docs.
Ah okay, I'll clear needinfo on Sheppy then.

For double checking the above list, I'd ask either Fabrice or Mounir.
Flags: needinfo?(eshepherd)
You need to log in before you can comment on or make changes to this bug.