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

consider using MessagingService objects #79

Description

@zolkis

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions