Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

consider using MessagingService objects #79

Open
zolkis opened this issue Aug 22, 2013 · 0 comments
Open

consider using MessagingService objects #79

zolkis opened this issue Aug 22, 2013 · 0 comments

Comments

@zolkis
Copy link
Contributor

zolkis commented Aug 22, 2013

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant