Hi Paul, sorry to bother you again!
I've checked the system messages API, and think it's a perfect fit for me! Now
I'm almost done implementing it, but there is just one thing I can't figure out.
To use the sendMessage() function I need to have the recipient's Manifest URI,
which I don't know how to figure out.
The sendMessage function's parameters are:
/*
* Allow any internal user to send a message of a given type to a given page
* of an app. The message will be sent to all the registered pages of the app
* when |pageURI| is not specified.
* @param type The type of the message to be sent.
* @param message The message payload.
* @param pageURI The URI of the page that will be opened. Nullable.
* @param manifestURI The webapp's manifest URI.
* @param extra Extra opaque information that will be passed around in
the observer
* notification to open the page.
* returns a Promise
*/
nsISupports sendMessage(in DOMString type, in jsval message,
in nsIURI pageURI, in nsIURI manifestURI,
[optional] in jsval extra);
I have found some methods that might be able to help me but I don't really know
how to use them. They're in B2G/gecko/dom/interfaces/apps/nsIAppsService.idl.
For example :
/**
* Returns the manifest URL associated to this localId.
*/
DOMString getManifestURLByLocalId(in unsigned long localId);
But I don't know how to get the local id.
If you have any idea how to do this, that would be awesome!
Thanks,
Sammy.
_______________________________________________
dev-fxos mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-fxos