nsISmsService 编辑

dom/sms/interfaces/nsISmsService.idlScriptable Used to send SMS text messages for the WebSMS API 1.0 66 Introduced Gecko 13.0 Inherits from: nsISupports Last changed in Gecko 15.0 (Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12)

Implemented by: @mozilla.org/sms/smsservice;1. To create an instance, use:

var smsService = Components.classes["@mozilla.org/sms/smsservice;1"]
                 .createInstance(Components.interfaces.nsISmsService);

Method overview

[implicit_jscontext] nsIDOMMozSmsMessage createSmsMessage(in long id, in DOMString delivery, in DOMString sender, in DOMString receiver, in DOMString body, in jsval timestamp, in bool read );
unsigned short getNumberOfMessagesForText(in DOMString text);
boolean hasSupport();
void send(in DOMString number, in DOMString message, in long requestId, [optional] in unsigned long long processId);

Methods

createSmsMessage()

[implicit_jscontext] nsIDOMMozSmsMessage createSmsMessage(
  in long id,
  in DOMString delivery,
  in DOMString sender,
  in DOMString receiver,
  in DOMString body,
  in jsval timestamp,
  in bool read
);
Parameters
id
A number representing the id of the message.
delivery
A DOMString which can either be "received" or "sent" and is representing the way the SMS was delivered.
sender
A DOMString with the name of the sender.
receiver
A DOMString with the name of the receiver.
body
A DOMString with the text of the message.
timestamp
A Date object with the timestamp of the message.
read
A Boolean indicating whether a message is marked as read or unread.
Return value

A SmsMessage

getNumberOfMessagesForText()

unsigned short getNumberOfMessagesForText(
  in DOMString text
);
Parameters
text
A DOMString text to check.
Return value

The number of multi-part SMS needed for a given text (160 characters for one SMS).

hasSupport()

Checks if the current platform has SMS support.

boolean hasSupport();
Return value

Boolean.

send()

void send(
  in DOMString number,
  in DOMString message,
  in long requestId,
  in unsigned long long processId Optional
);
Parameters
number
A DOMString with a telephone number to send to.
message
A DOMString with the text message.
requestId
Missing Description
processId Optional
Missing Description

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:99 次

字数:6384

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文