Closed Bug 715773 Opened 13 years ago Closed 13 years ago

B2G SMS: Package dom_sms.xpt and set temporary permission prefs

Categories

(Core :: DOM: Device Interfaces, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: philikon, Assigned: philikon)

References

Details

Attachments

(1 file)

Something like

pref("dom.sms.enabled", true);
pref("dom.sms.whitelist", "file://,http://localhost:8888,http://gaiamobile.org:8888");

should do it, but it doesn't for me right now. navigator.mozSms is still null. Investigating...
Turns out, dom_sms.xpt was also not being packaged.
Summary: B2G SMS: Set temporary permission prefs → B2G SMS: Package dom_sms.xpt and set temporary permission prefs
Attached patch v1Splinter Review
Assignee: nobody → philipp
Attachment #586629 - Flags: review?(jones.chris.g)
With this and a hack in Gaia (which expects a full-blown SMS API which we don't have yet, see https://github.com/andreasgal/gaia/commit/82cdd8fed9cd56a8e169ee32c9cc0fc296fa3102), I can *send* SMS! Receiving should work too, but Gaia would need more hacking for that.
Attachment #586629 - Flags: review?(jones.chris.g) → review+
We used to be able to receive SMS's, with the old android impl.
(In reply to Chris Jones [:cjones] [:warhammer] from comment #4)
> We used to be able to receive SMS's, with the old android impl.

Yes. But the API changed in the meantime. Not dramatically but enough to require a few changes [1]. Unfortunately I was too lazy to compile, setup and install B2G on my Android phone to make the correct changes to Gaia and Vivien was too lazy to use an Android backend again to do that. I guess now that the Android backend doesn't work with B2G, stuff will have to be fixed while they are pushed in the Gonk backend.

So, to make receiving work, we would have to change:
window.addEventListener('sms-received', [...]
to:
navigator.mozSms.addEventListener('received', [...]

[1] Most important change is that events are now sent to mozSms instead of window.
Sounds quite straightforward.  Let's make it so!
https://hg.mozilla.org/mozilla-central/rev/f5a4d6a88a6a
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: