This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Description
As noted on the Madrid F2F, the Messaging API could be simplified by using messaging service objects. A WebIDL fragment illustrating the idea:
Current way:
interface SmsManager : EventTarget {
readonly attribute MessageType type;
readonly attribute DOMString[] serviceIDs;
SmsSegmentInfo segmentInfo (DOMString text, optional DOMString serviceID);
Promise send (DOMString to, DOMString text, optional DOMString serviceID);
Promise clear (DOMString serviceID);
attribute EventHandler onreceived;
attribute EventHandler onsent;
attribute EventHandler ondeliverysuccess;
attribute EventHandler ondeliveryfailure;
attribute EventHandler onserviceadded;
attribute EventHandler onserviceremoved;
};
A possible alternative:
interface SmsManager : EventTarget {
readonly attribute SmsService[] services;
SmsSegmentInfo segmentInfo (DOMString text);
attribute EventHandler onreceived;
attribute EventHandler onsent;
attribute EventHandler ondeliverysuccess;
attribute EventHandler ondeliveryfailure;
attribute EventHandler onserviceadded;
attribute EventHandler onserviceremoved;
};
interface SmsService {
readonly attribute DOMString serviceId;
readonly attribute MessageType type;
Promise send (DOMString to, DOMString text);
Promise clear ();
};
Similarly, the same could be done for MMS.