© 2009-2010 OMTP Ltd. All rights reserved. OMTP and OMTP BONDI are registered trademarks of OMTP Ltd.
Send and manage text-, binary and multimedia-messages via Email, SMS, and MMS.
SMSArray
MMSArray
EmailArray
MMSSlideArray
FindSMSsSuccessCallback
FindMMSsSuccessCallback
FindEmailsSuccessCallback
EmailAccountsSuccessCallback
SubscriptionSuccessCallback
OnIncomingSMS
OnIncomingBinarySMS
OnIncomingMMS
OnIncomingEmail
MessagingError
MessagingManager
SMS
MMSSlide
MMS
Email
SMSProperties
SMSFilter
MMSProperties
MMSFilter
EmailProperties
EmailFilter
BinarySMSProperties
BinarySMS
BinarySMSFilter
MessagingManagerObject
| Interface | Method |
|---|---|
| FindSMSsSuccessCallback | void onSuccess(SMSArray obj) |
| FindMMSsSuccessCallback | void onSuccess(MMSArray obj) |
| FindEmailsSuccessCallback | void onSuccess(EmailArray obj) |
| EmailAccountsSuccessCallback | void onSuccess(StringArray obj) |
| SubscriptionSuccessCallback | void onSuccess(unsigned long subscriptionID) |
| OnIncomingSMS | void onEvent(SMS message) |
| OnIncomingBinarySMS | void onEvent(BinarySMS message) |
| OnIncomingMMS | void onEvent(MMS message) |
| OnIncomingEmail | void onEvent(Email message) |
| MessagingError | |
| MessagingManager | SMS createSMS(SMSProperties options) MMS createMMS(MMSProperties options) Email createEmail(EmailProperties options) BinarySMS createBinarySMS(BinarySMSProperties options) PendingOperation updateSMS(SuccessCallback successCallback, ErrorCallback errorCallback, SMS sms) PendingOperation updateMMS(SuccessCallback successCallback, ErrorCallback errorCallback, MMS mms) PendingOperation updateEmail(SuccessCallback successCallback, ErrorCallback errorCallback, Email email) PendingOperation sendSMS(SuccessCallback successCallback, ErrorCallback errorCallback, SMS sms, boolean store) PendingOperation sendMMS(SuccessCallback successCallback, ErrorCallback errorCallback, MMS mms, boolean store) PendingOperation sendEmail(SuccessCallback successCallback, ErrorCallback errorCallback, Email email, boolean store) PendingOperation sendBinarySMS(SuccessCallback successCallback, ErrorCallback errorCallback, BinarySMS binary) PendingOperation findSMSs(FindSMSsSuccessCallback successCallback, ErrorCallback errorCallback, ShortArray messageFolders, SMSFilter filter) PendingOperation findMMSs(FindMMSsSuccessCallback successCallback, ErrorCallback errorCallback, ShortArray messageFolders, MMSFilter filter) PendingOperation findEmails(FindEmailsSuccessCallback successCallback, ErrorCallback errorCallback, ShortArray messageFolders, EmailFilter filter) unsigned long getNumberOfSMSs(ShortArray messageFolders, boolean unread) unsigned long getNumberOfMMSs(ShortArray messageFolders, boolean unread) unsigned long getNumberOfEmails(ShortArray messageFolders, boolean unread) PendingOperation deleteSMS(SuccessCallback successCallback, ErrorCallback errorCallback, DOMString messageID, unsigned short folder) PendingOperation deleteMMS(SuccessCallback successCallback, ErrorCallback errorCallback, DOMString messageID, unsigned short folder) PendingOperation deleteEmail(SuccessCallback successCallback, ErrorCallback errorCallback, DOMString messageID, unsigned short folder) PendingOperation getAvailableEmailAccounts(EmailAccountsSuccessCallback successCallback, ErrorCallback errorCallback) PendingOperation subscribeToSMS(SubscriptionSuccessCallback successCallback, ErrorCallback errorCallback, OnIncomingSMS listener, SMSFilter filter, boolean exclusive) void unsubscribeFromSMS(unsigned long subscriptionID) PendingOperation subscribeToBinarySMS(SubscriptionSuccessCallback successCallback, ErrorCallback errorCallback, OnIncomingBinarySMS listener, BinarySMSFilter filter, boolean exclusive) void unsubscribeFromBinarySMS(unsigned long subscriptionID) PendingOperation subscribeToMMS(SubscriptionSuccessCallback successCallback, ErrorCallback errorCallback, OnIncomingMMS listener, MMSFilter filter, boolean exclusive) void unsubscribeFromMMS(unsigned long subscriptionID) PendingOperation subscribeToEmail(SubscriptionSuccessCallback successCallback, ErrorCallback errorCallback, OnIncomingEmail listener, EmailFilter filter, boolean exclusive) void unsubscribeFromEmail(unsigned long subscriptionID) |
| SMS | |
| MMSSlide | |
| MMS | |
| SMSProperties | |
| SMSFilter | |
| MMSProperties | |
| MMSFilter | |
| EmailProperties | |
| EmailFilter | |
| BinarySMSProperties | |
| BinarySMS | |
| BinarySMSFilter | |
| MessagingManagerObject |
Copyright 2010 OMTP Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
The BONDI messaging API provides access to the message sending device system and allows to create, send, delete and search for text-based and multimedia messages. The messages are sent via SMS, MMS, or EMail.
The differentiation of message types is explicitly implemented through the whole API, i.e., each message transmission service (e.g. SMS) is represented by a concrete data type. Thus, the application must first define what type of service should be used for message transmission before the actual message is prepared. For example, the application needs to send a short text message and decides to use SMS as the transmission mechanism. Then, the application will create a message object of type SMSMessage, fill it with the text content and send it out to one or multiple receivers. In order to change the message type, a new object of that type has to be created, filled with the previous content and then send via a specific method (e.g. sendSMS).
Multimedia messages can be composed by attaching files to certain message types (e.g. MMS and EMail). The possibility to define a flow for MMS also exists, following an OAA proposal.
This API also supports notifications about successful delivered messages.
This is the URI used to declare this API's feature set, for use in bondi.requestFeature. For the URL, the list of features included by the feature set is provided.
All the Messaging features
Includes API features:
http://bondi.omtp.org/api/1.1/messaging.email.send
http://bondi.omtp.org/api/1.1/messaging.mms.send
http://bondi.omtp.org/api/1.1/messaging.sms.send
http://bondi.omtp.org/api/1.1/messaging.binarysms.send
http://bondi.omtp.org/api/1.1/messaging.email.subscribe
http://bondi.omtp.org/api/1.1/messaging.mms.subscribe
http://bondi.omtp.org/api/1.1/messaging.sms.subscribe
http://bondi.omtp.org/api/1.1/messaging.binarysms.subscribe
http://bondi.omtp.org/api/1.1/messaging.email.getAccounts
http://bondi.omtp.org/api/1.1/messaging.email.attach
http://bondi.omtp.org/api/1.1/messaging.mms.attach
http://bondi.omtp.org/api/1.1/messaging.sms.get
http://bondi.omtp.org/api/1.1/messaging.mms.get
http://bondi.omtp.org/api/1.1/messaging.email.get
http://bondi.omtp.org/api/1.1/messaging.sms.delete
http://bondi.omtp.org/api/1.1/messaging.mms.delete
http://bondi.omtp.org/api/1.1/messaging.email.delete
This is the list of URIs used to declare this API's features, for use in bondi.requestFeature. For each URL, the list of functions covered is provided.
When any of the features
http://bondi.omtp.org/api/1.1/messaging.email.send
http://bondi.omtp.org/api/1.1/messaging.mms.send
http://bondi.omtp.org/api/1.1/messaging.sms.send
http://bondi.omtp.org/api/1.1/messaging.binarysms.send
http://bondi.omtp.org/api/1.1/messaging.email.subscribe
http://bondi.omtp.org/api/1.1/messaging.mms.subscribe
http://bondi.omtp.org/api/1.1/messaging.sms.subscribe
http://bondi.omtp.org/api/1.1/messaging.binarysms.subscribe
http://bondi.omtp.org/api/1.1/messaging.email.getAccounts
http://bondi.omtp.org/api/1.1/messaging.email.attach
http://bondi.omtp.org/api/1.1/messaging.mms.attach
http://bondi.omtp.org/api/1.1/messaging.sms.get
http://bondi.omtp.org/api/1.1/messaging.mms.get
http://bondi.omtp.org/api/1.1/messaging.email.get
http://bondi.omtp.org/api/1.1/messaging.sms.delete
http://bondi.omtp.org/api/1.1/messaging.mms.delete
http://bondi.omtp.org/api/1.1/messaging.email.delete
is successfully requested, the interface
MessagingManager
is instantiated, and the resulting object appears in the global
namespace as
Bondi.messaging.
Call to the sendEmail in the messagingManager
Device capabilities:
messaging.email.send
Call to the sendMMS in the messagingManager
Device capabilities:
messaging.mms.send
Call to the sendSMS method in the messagingManager
Device capabilities:
messaging.sms.send
Call to the sendBinary method in the messagingManager
Device capabilities:
messaging.binarysms.send
Call to the findSMSs method in the messagingManager
Device capabilities:
messaging.sms.get
Call to the findMMSs method in the messagingManager
Device capabilities:
messaging.mms.get
Call to the findEmails method in the messagingManager
Device capabilities:
messaging.email.get
Call to the deleteSMS method in the messagingManager
Device capabilities:
messaging.sms.delete
Call to the deleteMMS method in the messagingManager
Device capabilities:
messaging.mms.delete
Call to the deleteEmail method in the messagingManager
Device capabilities:
messaging.email.delete
Call to the getAvailableEmailAccounts method in the messagingManager
Device capabilities:
messaging.email.getAccounts
Call to the updateEmail
Device capabilities:
messaging.email.attach
io.file.read
Call to the updateMMS
Device capabilities:
messaging.mms.attach
io.file.read
Call to the subscribeToSMS method
Device capabilities:
messaging.sms.subscribe
Call to the subscribeToMMS method
Device capabilities:
messaging.mms.subscribe
Call to the subscribeToEmail method
Device capabilities:
messaging.email.subscribe
Call to the subscribeToBinarySMS method
Device capabilities:
messaging.binarysms.subscribe
messaging.sms.get
Retrieve SMS
Security parameters:
folders:
Space-separated list of folder identifiers
from which the messages are to be retrieved.
messaging.mms.get
Retrieve MMS
Security parameters:
folders:
Space-separated list of folder identifiers
from which the messages are to be retrieved.
messaging.email.get
Retrieve email
Security parameters:
folders:
Space-separated list of folder identifiers
from which the messages are to be retrieved.
messaging.sms.delete
Delete SMS
Security parameters:
folder:
Folder identifier
from which the message is to be deleted.
messaging.mms.delete
Delete MMS
Security parameters:
folder:
Folder identifier
from which the message is to be deleted.
messaging.email.delete
Delete email
Security parameters:
folder:
Folder identifier
from which the message is to be deleted.
messaging.email.attach
Add/change attachment on an email
messaging.mms.attach
Add/change attachment on an MMS
messaging.email.getAccounts
Get email accounts
messaging.email.send
Sends an email message
Security parameters:
recipients:
Space-separated list of all recipients' addresses (from to, cc and bcc attributes).
incontacts:
yes or undefined value depending on whether all
recipients are in contacts list
messaging.mms.send
Sends an MMS message
Security parameters:
recipients:
Space-separated list of all recipients' phone numbers (from to, cc and bcc attributes). Any
international phone number must start with a U+002B PLUS SIGN.
incontacts:
yes or undefined value depending on whether all
recipients are in contacts list
messaging.sms.send
Sends an sms message
Security parameters:
recipients:
Space-separated list of all recipients' phone numbers (from to attribute). Any
international phone number must start with a U+002B PLUS SIGN.
incontacts:
yes or undefined value depending on whether all
recipients are in contacts list
messaging.binarysms.send
Sends a binary message
Security parameters:
recipients:
Space-separated list of all recipients' phone numbers (from to attribute). Any
international phone number must start with a U+002B PLUS SIGN.
incontacts:
yes or undefined value depending on whether all
recipients are in contacts list
port:
SMS application port number to which the message is addressed
messaging.mms.subscribe
Subscribe to MMS message notifications
Security parameters:
sender:
Sender of the message
messaging.sms.subscribe
Subscribe to sms message notifications
Security parameters:
sender:
Sender of the message
messaging.email.subscribe
Subscribe to email message notifications
Security parameters:
sender:
Sender of the message
messaging.binarysms.subscribe
Subscribe to binary message notifications
Security parameters:
sender:
Sender of the message
port:
SMS application port number to which the message is addressed
SMSArray
Array of SMS.
typedef sequence<SMS> SMSArray;
MMSArray
Array of MMS.
typedef sequence<MMS> MMSArray;
EmailArray
Array of Email.
typedef sequence<Email> EmailArray;
MMSSlideArray
Array of slides
typedef sequence<MMSSlide> MMSSlideArray;
FindSMSsSuccessCallback
Success callback for retrieving a list of SMS.
[Callback=FunctionOnly, NoInterfaceObject] interface FindSMSsSuccessCallback {
void onSuccess(in SMSArray obj);
};
Success callback that takes an array of SMSs as input argument. It is used in the asynchronous operation to get the list of SMSs.
onSuccess
Method invoked when a list of SMSs is retrieved successfully
void onSuccess(in SMSArray obj);
FindMMSsSuccessCallback
Success callback for retrieving a list of MMS.
[Callback=FunctionOnly, NoInterfaceObject] interface FindMMSsSuccessCallback {
void onSuccess(in MMSArray obj);
};
Success callback that takes an array of MMSs as input argument. It is used in the asynchronous operation to get the list of MMSs.
onSuccess
Method invoked when a list of MMSs is retrieved successfully
void onSuccess(in MMSArray obj);
FindEmailsSuccessCallback
Success callback for retrieving a list of E-mails.
[Callback=FunctionOnly, NoInterfaceObject] interface FindEmailsSuccessCallback {
void onSuccess(in EmailArray obj);
};
Success callback that takes an array of E-mails as its input argument. It is used in the asynchronous operation to get the list of E-Mails.
onSuccess
Method invoked when a list of e-mails is retrieved successfully
void onSuccess(in EmailArray obj);
EmailAccountsSuccessCallback
Success callback for retrieving a list of email accounts.
[Callback=FunctionOnly, NoInterfaceObject] interface EmailAccountsSuccessCallback {
void onSuccess(in StringArray obj);
};
Success callback that is used in the asynchronous operation to get the list of Available email accounts.
onSuccess
Method invoked when the list of available email accounts is retrieved successfully
void onSuccess(in StringArray obj);
SubscriptionSuccessCallback
Success callback for subscription to incoming messages
[Callback=FunctionOnly, NoInterfaceObject] interface SubscriptionSuccessCallback {
void onSuccess(in unsigned long subscriptionID);
};
Success callback that is used in the asynchronous operation to subscribe to the incoming messages.
onSuccess
Method invoked when subscribing is successful
void onSuccess(in unsigned long subscriptionID);
OnIncomingSMS
To be invoked when an application must be notified of an incoming SMS event
[Callback=FunctionOnly, NoInterfaceObject] interface OnIncomingSMS {
void onEvent(in SMS message);
};
onEvent
To be invoked when an application must be notified on an incoming SMS event
void onEvent(in SMS message);
OnIncomingBinarySMS
To be invoked when an application must be notified of an incoming Binary Message event
[Callback=FunctionOnly, NoInterfaceObject] interface OnIncomingBinarySMS {
void onEvent(in BinarySMS message);
};
onEvent
To be invoked when an application must be notified on an incoming Binary Message event
void onEvent(in BinarySMS message);
OnIncomingMMS
To be invoked when an application must be notified fn an incoming MMS event
[Callback=FunctionOnly, NoInterfaceObject] interface OnIncomingMMS {
void onEvent(in MMS message);
};
onEvent
To be invoked when an application must be notified on an incoming MMS event
void onEvent(in MMS message);
OnIncomingEmail
To be invoked when an application must be notified of an incoming e-mail event
[Callback=FunctionOnly, NoInterfaceObject] interface OnIncomingEmail {
void onEvent(in Email message);
};
onEvent
To be invoked when an application must be notified on an incoming Email event
void onEvent(in Email message);
MessagingError
Messaging Errors
interface MessagingError : GenericError {
const unsigned short OUT_OF_COVERAGE_ERROR = 1;
const unsigned short MMS_VIDEO_SLIDE_ERROR = 2;
const unsigned short MMS_MESSAGE_SIZE_EXCEEDED_ERROR = 3;
};
unsigned short OUT_OF_COVERAGE_ERROR
There is no coverage
unsigned short MMS_VIDEO_SLIDE_ERROR
Media addition is not possible, since the slide already includes a media file that cannot coexist with the others.
unsigned short MMS_MESSAGE_SIZE_EXCEEDED_ERROR
Message size would be exceeded by the given operation.
MessagingManager
class for managing all messaging functions
interface MessagingManager {
const unsigned short INBOX_FOLDER = 0;
const unsigned short SENT_FOLDER = 1;
const unsigned short OUTBOX_FOLDER = 2;
const unsigned short DRAFTS_FOLDER = 3;
SMS createSMS([Optional] in SMSProperties options)
raises(DeviceAPIError);
MMS createMMS([Optional] in MMSProperties options)
raises(DeviceAPIError);
Email createEmail([Optional] in EmailProperties options)
raises(DeviceAPIError);
BinarySMS createBinarySMS([Optional] in BinarySMSProperties options)
raises(DeviceAPIError);
PendingOperation updateSMS(in SuccessCallback successCallback,
in ErrorCallback errorCallback,
in SMS sms);
PendingOperation updateMMS(in SuccessCallback successCallback,
in ErrorCallback errorCallback,
in MMS mms);
PendingOperation updateEmail(in SuccessCallback successCallback,
in ErrorCallback errorCallback,
in Email email);
PendingOperation sendSMS(in SuccessCallback successCallback,
in ErrorCallback errorCallback,
in SMS sms, [Optional] in boolean store);
PendingOperation sendMMS(in SuccessCallback successCallback,
in ErrorCallback errorCallback,
in MMS mms, [Optional] in boolean store);
PendingOperation sendEmail(in SuccessCallback successCallback,
in ErrorCallback errorCallback,
in Email email, [Optional] in boolean store);
PendingOperation sendBinarySMS(in SuccessCallback successCallback,
in ErrorCallback errorCallback,
in BinarySMS binary);
PendingOperation findSMSs(in FindSMSsSuccessCallback successCallback,
in ErrorCallback errorCallback,
in ShortArray messageFolders,
[Optional]in SMSFilter filter);
PendingOperation findMMSs(in FindMMSsSuccessCallback successCallback,
in ErrorCallback errorCallback,
in ShortArray messageFolders,
[Optional]in MMSFilter filter);
PendingOperation findEmails(in FindEmailsSuccessCallback successCallback,
in ErrorCallback errorCallback,
in ShortArray messageFolders,
[Optional]in EmailFilter filter);
unsigned long getNumberOfSMSs(in ShortArray messageFolders,
[Optional] in boolean unread)
raises(DeviceAPIError);
unsigned long getNumberOfMMSs(in ShortArray messageFolders,
[Optional] in boolean unread)
raises(DeviceAPIError);
unsigned long getNumberOfEmails(in ShortArray messageFolders,
[Optional] in boolean unread)
raises(DeviceAPIError);
PendingOperation deleteSMS(in SuccessCallback successCallback,
in ErrorCallback errorCallback,
in DOMString messageID, in unsigned short folder);
PendingOperation deleteMMS(in SuccessCallback successCallback,
in ErrorCallback errorCallback,
in DOMString messageID, in unsigned short folder);
PendingOperation deleteEmail(in SuccessCallback successCallback,
in ErrorCallback errorCallback,
in DOMString messageID, in unsigned short folder);
PendingOperation getAvailableEmailAccounts(in EmailAccountsSuccessCallback successCallback,
in ErrorCallback errorCallback);
PendingOperation subscribeToSMS (in SubscriptionSuccessCallback successCallback,
in ErrorCallback errorCallback,
in OnIncomingSMS listener,
in SMSFilter filter,
in boolean exclusive);
void unsubscribeFromSMS (in unsigned long subscriptionID)
raises(SecurityError, DeviceAPIError);
PendingOperation subscribeToBinarySMS (in SubscriptionSuccessCallback successCallback,
in ErrorCallback errorCallback,
in OnIncomingBinarySMS listener,
in BinarySMSFilter filter,
in boolean exclusive);
void unsubscribeFromBinarySMS (in unsigned long subscriptionID)
raises(DeviceAPIError);
PendingOperation subscribeToMMS (in SubscriptionSuccessCallback successCallback,
in ErrorCallback errorCallback,
in OnIncomingMMS listener,
in MMSFilter filter,
in boolean exclusive);
void unsubscribeFromMMS (in unsigned long subscriptionID)
raises(DeviceAPIError);
PendingOperation subscribeToEmail (in SubscriptionSuccessCallback successCallback,
in ErrorCallback errorCallback,
in OnIncomingEmail listener,
in EmailFilter filter,
in boolean exclusive);
void unsubscribeFromEmail (in unsigned long subscriptionID)
raises(DeviceAPIError);
};
The messaging manager interface provides methods to create and send messages.
unsigned short INBOX_FOLDER
Constant used to identify the INBOX folder.
unsigned short SENT_FOLDER
Constant used to identify the SENT folder.
unsigned short OUTBOX_FOLDER
Constant used to identify the OUTBOX folder.
unsigned short DRAFTS_FOLDER
Constant used to identify the DRAFTS folder.
createSMS
Creates an SMS object from the options provided as a parameter.
SMS createSMS(in SMSProperties options);
INVALID_ARGUMENT_ERROR if options is not a valid SMSProperties object
var sms = bondi.messaging.createSMS({to:["+34666666666"],body:"Hello there"});
createMMS
Creates an MMS object from the options provided as a parameter.
MMS createMMS(in MMSProperties options);
INVALID_ARGUMENT_ERROR if options is not a valid MMSProperties object
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?"});
createEmail
Creates an Email object from the options provided as a parameter.
Email createEmail(in EmailProperties options);
INVALID_ARGUMENT_ERROR if options is not a valid EmailProperties object
var email = bondi.messaging.createEmail({from:"address1@vodafone.com", to:"address2@vodafone.com",
cc:"address3@vodafone.com", bcc:"address4@vodafone.com", subject:"Hello there", body:"How Are You?"});
createBinarySMS
Creation of an Binary object
BinarySMS createBinarySMS(in BinarySMSProperties options);
Creates an Binary object from the options provided as a parameter.
INVALID_ARGUMENT_ERROR if options is not a valid BinarySMSProperties object
//reads all the bytes from a file
var image = bondi.filesystem.resolve("myPicture.jpg");
var stream = image.open("r", "UTF-8");
var raw = stream.readBytes(0);
//creates a binary message with the values passed as parameters
var binaryMessage = bondi.messaging.createBinarySMS({to:["+34666666666"], port:25657, payload:raw});
updateSMS
Creates or updates the copy of the SMS stored in the Drafts folder with the local object representing the message.
PendingOperation updateSMS(in SuccessCallback successCallback, in ErrorCallback errorCallback, in SMS sms);
Errors that can be returned in the ErrorCallback:
var sms = bondi.messaging.createSMS({to:["+34666666666"],body:"Hello there"});
//store the message in the Drafts folder
bondi.messaging.updateSMS(sms);
sms.body = "Hi there";
//updates the draft message
bondi.messaging.updateSMS(sms);
updateMMS
Creates or updates the copy of the MMS stored in the Drafts folder with the local object representing the message.
PendingOperation updateMMS(in SuccessCallback successCallback, in ErrorCallback errorCallback, in MMS mms);
Errors that can be returned in the ErrorCallback:
var mms = bondi.messaging.createMMS({to:["+34666666666"],subject:"Hello there",body:"How Are You?"});
//store the message in the Drafts folder
bondi.messaging.updateMMS(mms);
mms.subject = "Hi there";
//updates the draft message
bondi.messaging.updateMMS(mms);
updateEmail
Creates or updates the copy of the email stored in the Drafts folder with the local object representing the message.
PendingOperation updateEmail(in SuccessCallback successCallback, in ErrorCallback errorCallback, in Email email);
Errors that can be returned in the ErrorCallback:
var email = bondi.messaging.createEmail({from:"address1@vodafone.com",to:"address2@vodafone.com",subject:"Hello there",body:"How Are You?"});
//store the message in the Drafts folder
bondi.messaging.updateEmail(email);
email.subject = "Hi there";
//updates the draft message
bondi.messaging.updateEmail(email);
sendSMS
This method creates or updates a SMS object in the Drafts folder and sends it.
PendingOperation sendSMS(in SuccessCallback successCallback, in ErrorCallback errorCallback, in SMS sms, in boolean store);
When the message has been sent it is stored in the Sent message folder (if the store property is true). It is an asynchronous method. The success method is executed when the SMS has been marked to be sent and stored in the Outgoing messaging folders. After this the OS is forced to sync mail folders.
Errors that can be returned in the ErrorCallback:
//This method creates a SMS message with the values passed as parameters
var sms = bondi.messaging.createSMS({body:"Just arrived",to:["+34666666666"]});
// Define the success callback
function successCallback(response) {
alert("Sent");
}
// Define the error callback
function errorCallback(response) {
alert( "The following error code: " + response.code);
}
//This method sends the previous created message
bondi.messaging.sendSMS(successCallback, errorCallback, sms, false);
sendMMS
This method creates or updates a SMS object in the Drafts folder and sends it.
PendingOperation sendMMS(in SuccessCallback successCallback, in ErrorCallback errorCallback, in MMS mms, in boolean store);
When the message has been sent it is stored in the Sent message folder (if the store property is true). It is an asynchronous method. The success method is executed when the MMS has been marked to be sent and stored in the Outgoing messaging folders. After this the OS is forced to sync mail folders.
Errors that can be returned in the ErrorCallback:
var mms = bondi.messaging.createMMS(null);
mms.body = "Just arrived";
mms.subject = "Hello there";
mms.to = ["+34666666666"];
// Define the success callback.
function successCallback(response) {
alert("Sent");
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error code: " + response.code);
}
// Send the MMS.
bondi.messaging.sendMMS(successCallback, errorCallback, mms, false);
sendEmail
This method creates or updates a Email object in the Drafts folder and sends it.
PendingOperation sendEmail(in SuccessCallback successCallback, in ErrorCallback errorCallback, in Email email, in boolean store);
When the message has been sent it is stored in the Sent message folder (if the store property is true). It is an asynchronous method. The success method is executed when the MMS has been marked to be sent and stored in the Outgoing messaging folders. After this the OS is forced to sync mail folders.
Errors that can be returned in the ErrorCallback:
var email = bondi.messaging.createEmail();
email.body = "Just arrived";
email.subject = "Hello there";
email.to = "address1@vodafone.com";
// Define the success callback.
function successCallback(response) {
alert("Sent");
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error code: " + response.code);
}
// Send the e-mail.
bondi.messaging.sendEmail(successCallback, errorCallback, email, true);
sendBinarySMS
This method Sends a BinarySMS object.
PendingOperation sendBinarySMS(in SuccessCallback successCallback, in ErrorCallback errorCallback, in BinarySMS binary);
It is an asynchronous method. The success method is executed when the Binary has been marked to be sent and stored in the Outgoing messaging folders. After this the OS is forced to sync mail folders.
Errors that can be returned in the ErrorCallback:
// reads all the bytes from a file
var image = bondi.filesystem.resolve("myPicture.jpg");
var stream = image.open("r", "UTF-8");
var raw = stream.readBytes(0);
//creates a binary message with the values passed as parameters
bondi.messaging.createBinarySMS({to:["+34666666666"],port:25657,payload:raw});
function successCallback(response) {
alert("Sent");
}
function errorCallback(response) {
alert( "The following error code: " + response.code);
}
//sends the prevoiusly created message
bondi.messaging.sendBinarySMS(successCallback, errorCallback,binary);
findSMSs
Get the list of selected SMSs
PendingOperation findSMSs(in FindSMSsSuccessCallback successCallback, in ErrorCallback errorCallback, in ShortArray messageFolders, in SMSFilter filter);
Gets an array of SMSMessages objects for sms messages stored within the selected folders and matching the selected filter.
This is an asynchronous method.
The filtering is implemented according to the design patterns (chapter 2.4). If no filter is passed all the messages will be returned.
In a search using strings, the search conductes is case sensitive. If the string is found anywhere inside the key object value, the entire object will be returned.
Errors that can be returned in the ErrorCallback:
// Define the success callback.
function successCallback(response) {
var messages = response;
// Get first message in the list of results
var sms = messages[0];
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error code is: " + response.code);
}
// Get the SMSs for the specified filter.
bondi.messaging.findSMSs(successCallback, errorCallback,
[ bondi.messaging.DRAFTS_FOLDER, bondi.messaging.OUTBOX_FOLDER],
{ to:"+34666666666", body:"Huesca"});
findMMSs
Get the list of selected MMSs
PendingOperation findMMSs(in FindMMSsSuccessCallback successCallback, in ErrorCallback errorCallback, in ShortArray messageFolders, in MMSFilter filter);
Gets an array of MMSMessage objects for MMS messages stored within the selected folders matching the selected filter.
The filtering is implemented according to the design patterns (chapter 2.4). If no filter is passed all the messages will be returned.
This is an asynchronous method.
Errors that can be returned in the ErrorCallback:
// Define the success callback.
function successCallback(response) {
var messages = response;
// Get first MMS in the list of results
var mms = messages[0];
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error code is: " + response.code);
}
// Get the MMSs for the specified filter.
bondi.messaging.findMMSs(successCallback, errorCallback,
[bondi.messaging.INBOX_FOLDER],
{from:"+34666666666", body:"Huesca"});
findEmails
Get the list of selected Emails
PendingOperation findEmails(in FindEmailsSuccessCallback successCallback, in ErrorCallback errorCallback, in ShortArray messageFolders, in EmailFilter filter);
The filtering is implemented according to the design patterns (chapter 2.4). If no filter is passed all the messages will be returned.
Errors that can be returned in the ErrorCallback:
// Define the success callback.
function successCallback(response) {
var messages = response;
// Get first email in the list of results
var email = messages[0];
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error code is: " + response);
}
// Get the Emails for the specified filter.
bondi.messaging.findEmails(successCallback, errorCallback,
[ bondi.messaging.INBOX_FOLDER, bondi.messaging.OUTBOX_FOLDER],
{ to:"bondi@omtp.org", body:"Huesca"});
getNumberOfSMSs
Get the number of SMS messages in a messaging folder
unsigned long getNumberOfSMSs(in ShortArray messageFolders, in boolean unread);
Gets the number of SMS messages that are stored in the folder passed as input argument. If the unread input parameter is set to true, it will only return the number of unread messages of that type stored in the folder, otherwise it will return the total number (read and unread).
INVALID_ARGUMENT_ERROR if parameters are not valid
var foldersArray = [];
foldersArray.push(bondi.messaging.INBOX_FOLDER);
foldersArray.push(bondi.messaging.OUTBOX_FOLDER);
var number = bondi.messaging.getNumberOfSMSs(foldersArray, true);
alert("There are " + number + " unread SMSs");
getNumberOfMMSs
Get the number of MMS messages in a messaging folder
unsigned long getNumberOfMMSs(in ShortArray messageFolders, in boolean unread);
Gets the number of MMS messages that are stored in the folder passed as input argument. If the unread input parameter is set to true, it will only return the number of unread messages of that type stored in the folder, otherwise it will return the total number (read and unread).
INVALID_ARGUMENT_ERROR if parameters are not valid
var foldersArray = [];
foldersArray.push(bondi.messaging.INBOX_FOLDER);
foldersArray.push(bondi.messaging.OUTBOX_FOLDER);
var number = bondi.messaging.getNumberOfMMSs(foldersArray, true);
alert("There are " + number + " unread MMSs");
getNumberOfEmails
Get the number of email messages in a messaging folder
unsigned long getNumberOfEmails(in ShortArray messageFolders, in boolean unread);
Gets the number of email messages that are stored in the folder passed as input argument. If the unread input parameter is set to true, it will only return the number of unread messages of that type stored in the folder, otherwise it will return the total number (read and unread).
INVALID_ARGUMENT_ERROR if parameters are not valid
var foldersArray = [];
foldersArray.push(bondi.messaging.INBOX_FOLDER);
foldersArray.push(bondi.messaging.OUTBOX_FOLDER);
var number = bondi.messaging.getNumberOfEmails(foldersArray, true);
alert("There are " + number + " unread SMSs");
deleteSMS
Deletes SMS message
PendingOperation deleteSMS(in SuccessCallback successCallback, in ErrorCallback errorCallback, in DOMString messageID, in unsigned short folder);
Removes the SMS identified by its id.
Errors that can be returned in the ErrorCallback:
// Define the success callback.
function successCallback(response)
{
alert("Message deleted");
}
// Define the error callback.
function errorCallback(response)
{
alert( "The following error code occured: " + response.code);
}
// Delete SMS from INBOX
bondi.messaging.deleteSMS(successCallback, errorCallback, id, INBOX_FOLDER);
deleteMMS
Deletes MMS message
PendingOperation deleteMMS(in SuccessCallback successCallback, in ErrorCallback errorCallback, in DOMString messageID, in unsigned short folder);
Removes the MMS identified by its id.
Errors that can be returned in the ErrorCallback:
// Define the success callback.
function successCallback(response)
{
alert("Message deleted");
}
// Define the error callback.
function errorCallback(response)
{
alert( "The following error code occured: " + response.code);
}
// Delete MMS from INBOX
bondi.messaging.deleteMMS(successCallback, errorCallback, id, INBOX_FOLDER);
deleteEmail
Deletes Email message
PendingOperation deleteEmail(in SuccessCallback successCallback, in ErrorCallback errorCallback, in DOMString messageID, in unsigned short folder);
Removes the SMS identified by its id.
Errors that can be returned in the ErrorCallback:
// Define the success callback.
function successCallback(response)
{
alert("Message deleted");
}
// Define the error callback.
function errorCallback(response)
{
alert( "The following error code occured: " + response.code);
}
// Delete email from DRAFTS folter
bondi.messaging.deleteEmail(successCallback, errorCallback, id, DRAFTS_FOLDER);
getAvailableEmailAccounts
Retrieves available e-mail accounts
PendingOperation getAvailableEmailAccounts(in EmailAccountsSuccessCallback successCallback, in ErrorCallback errorCallback);
This method gets available email accounts that can be used (to be included in the From field). These addresses are separated by semicolons(";"). This is an asynchronous method. Returns null if no email accounts are configured in the terminal.
Errors that can be returned in the ErrorCallback:
// Define the success callback.
function successCallback(response) {
var email = bondi.messaging.createEmail({from:response[0]});
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error code: " + response.code)
}
// Get the available e-mail accounts.
var accounts = bondi.messaging.getAvailableEmailAccounts(successCallback, errorCallback);
subscribeToSMS
Subscribes to receive notifications on incoming SMS
PendingOperation subscribeToSMS(in SubscriptionSuccessCallback successCallback, in ErrorCallback errorCallback, in OnIncomingSMS listener, in SMSFilter filter, in boolean exclusive);
Allows applications to be notified whenever an incoming SMS meets a set of conditions specified by the filter. It is possible for applications to request exclusive notifications. The returned identifier may be used to unsubscribe from these events using the unsubscribe method.
Errors that can be returned in the ErrorCallback:
var subscriptionID = 0;
// Define the success callback to get the subscription ID.
function successCallback(id) {
subscriptionID = id;
}
function smslistener(sms) {
alert("Marcin sent an SMS: "+ sms.body);
}
// Define the error callback.
function errorCallback(response) {
alert( "SMS subscription failed. The error code is: " + response.code);
}
var pendop = bondi.messaging.subscribeToSMS(
successCallback, errorCallback, smslistener, {from:"+491638290646"}, true );
unsubscribeFromSMS
Unsubscribe from SMS notifications
void unsubscribeFromSMS(in unsigned long subscriptionID);
INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
var subscriptionID = 0;
// Define the success callback to get the subscription ID.
function successCallback(id) {
subscriptionID = id;
}
function smslistener(sms) {
alert("Incoming SMS: "+ sms.body);
}
// Define the error callback.
function errorCallback(response) {
alert( "SMS subscription failed. The error code is: " + response.code);
}
var pendop = bondi.messaging.subscribeToSMS(
successCallback, errorCallback, smslistener, {from:"+491638290646"}, true );
bondi.messaging.unsubscribeFromSMS(subscriptionID);
subscribeToBinarySMS
Subscribes to receive notifications on incoming binary messages
PendingOperation subscribeToBinarySMS(in SubscriptionSuccessCallback successCallback, in ErrorCallback errorCallback, in OnIncomingBinarySMS listener, in BinarySMSFilter filter, in boolean exclusive);
Allows applications to be notified whenever an incoming binary message meets a set of conditions specified by the filter. It is possible for applications to request exclusive notifications. The returned identifier may be used to unsubscribe from these events using the unsubscribe method.
Errors that can be returned in the ErrorCallback:
var subscriptionID = 0;
// Define the success callback to get the subscription ID.
function successCallback(id) {
subscriptionID = id;
}
function binsmslistener(binsms) {
alert("Incoming BinarySMS: "+ binsms.payload);
}
// Define the error callback.
function errorCallback(response) {
alert( "Binary SMS subscription failed. The error code is: " + response.code);
}
var pendop = bondi.messaging.subscribeToBinarySMS(
successCallback, errorCallback, binsmslistener, {from:"+491638290646"}, true );
unsubscribeFromBinarySMS
Unsubscribe from Binary Messages notifications
void unsubscribeFromBinarySMS(in unsigned long subscriptionID);
INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
var subscriptionID = 0;
// Define the success callback to get the subscription ID.
function successCallback(id) {
subscriptionID = id;
}
function binsmslistener(binsms) {
alert("Incoming BinarySMS: "+ binsms.payload);
}
// Define the error callback.
function errorCallback(response) {
alert( "Binary SMS subscription failed. The error code is: " + response.code);
}
var pendop = bondi.messaging.subscribeToBinarySMS(
successCallback, errorCallback, binsmslistener, {from:"+491638290646"}, true );
bondi.messaging.unsubscribeFromBinarySMS(subscriptionID);
subscribeToMMS
Subscribes to receive notifications on incoming MMS
PendingOperation subscribeToMMS(in SubscriptionSuccessCallback successCallback, in ErrorCallback errorCallback, in OnIncomingMMS listener, in MMSFilter filter, in boolean exclusive);
Allows applications to be notified whenever an incoming MMS meets a set of conditions specified by the filter. It is possible for applications to request exclusive notifications. The returned identifier may be used to unsubscribe from these events using the unsubscribe method.
Errors that can be returned in the ErrorCallback:
var subscriptionID = 0;
// Define the success callback to get the subscription ID.
function successCallback(id) {
subscriptionID = id;
}
function mmslistener(sms) {
alert("Incoming MMS: "+ mms.body);
}
// Define the error callback.
function errorCallback(response) {
alert( "MMS subscription failed. The error code is: " + response.code);
}
var pendop = bondi.messaging.subscribeToMMS(
successCallback, errorCallback, mmslistener, {from:"+491638290646"}, true );
unsubscribeFromMMS
Unsubscribe from notifications about incoming MMS messages
void unsubscribeFromMMS(in unsigned long subscriptionID);
INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
var subscriptionID = 0;
// Define the success callback to get the subscription ID.
function successCallback(id) {
subscriptionID = id;
}
function mmslistener(sms) {
alert("Incoming MMS: "+ mms.body);
}
// Define the error callback.
function errorCallback(response) {
alert( "MMS subscription failed. The error code is: " + response.code);
}
var pendop = bondi.messaging.subscribeToMMS(
successCallback, errorCallback, mmslistener, {from:"+491638290646"}, true );
bondi.messaging.unsubscribeFromMMS(subscriptionID);
subscribeToEmail
Subscribes to receive notifications on incoming e-mail
PendingOperation subscribeToEmail(in SubscriptionSuccessCallback successCallback, in ErrorCallback errorCallback, in OnIncomingEmail listener, in EmailFilter filter, in boolean exclusive);
Allows applications to be notified whenever an incoming e-mail meets a set of conditions specified by the filter. It is possible for applications to request exclusive notifications. The returned identifier may be used to unsubscribe from these events using the unsubscribe method.
Errors that can be returned in the ErrorCallback:
var subscriptionID = 0;
// Define the success callback to get the subscription ID.
function successCallback(id) {
subscriptionID = id;
}
function mmslistener(email) {
alert("Incoming email from Marcin: "+ email.body);
}
// Define the error callback.
function errorCallback(response) {
alert( "Mail subscription failed. The error code is: " + response.code);
}
var pendop = bondi.messaging.subscribeToEmail(
successCallback, errorCallback, emaillistener, {from:"marcin.hanclik@access-company.com"}, false );
unsubscribeFromEmail
Unsubscribe from e-mail notifications
void unsubscribeFromEmail(in unsigned long subscriptionID);
INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
var subscriptionID = 0;
// Define the success callback to get the subscription ID.
function successCallback(id) {
subscriptionID = id;
}
function mmslistener(email) {
alert("Incoming email from Marcin: "+ email.body);
}
// Define the error callback.
function errorCallback(response) {
alert( "Mail subscription failed. The error code is: " + response.code);
}
var pendop = bondi.messaging.subscribeToEmail(
successCallback, errorCallback, emaillistener, {from:"marcin.hanclik@access-company.com"}, false );
bondi.messaging.unsubscribeFromEmail(subscriptionID);
SMS
SMS Message API
interface SMS : SMSProperties {
readonly attribute DOMString id;
};
The SMS Message interface provides methods to populate and send a message.
readonly
DOMString id
The unique identifier assigned to the message in the platform.
This is a readonly property.
var sms = bondi.messaging.createSMS();
bondi.messaging.updateSMS(sms);
var id = sms.id;
MMSSlide
MMS Slide is a triplet of an image, audio and text. Optionally it can include a video as a replacement for image and audio.
interface MMSSlide {
attribute unsigned long duration;
attribute DOMString image
setraises(MessagingError);
attribute unsigned long imageBegin;
attribute unsigned long imageEnd;
attribute DOMString audio
setraises(MessagingError);
attribute unsigned long audioBegin;
attribute unsigned long audioEnd;
attribute DOMString text
setraises(MessagingError);
attribute unsigned long textBegin;
attribute unsigned long textEnd;
attribute DOMString video;
attribute unsigned long videoBegin;
attribute unsigned long videoEnd;
};
http://www.openmobilealliance.org/Technical/release_program/docs/MMS/V1_3-20080128-C/OMA-TS-MMS-CONF-V1_3-20080128-C.pdf section 8: "A slide that contains video SHALL contain only video and text components."
unsigned long duration
Duration of the slide presentation, in milliseconds.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mms.slides[0].duration = 3000;
DOMString image
File containing an image.
MMS_MESSAGE_SIZE_EXCEEDED_ERROR if the message size would be exceeded by the adding operation
MMS_VIDEO_SLIDE_ERROR if the slide already includes video part.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mm.slides[0].image = "myPicture.jpg";
unsigned long imageBegin
Beginning of image presentation within a slide, in milliseconds.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mms.slides[0].imageBegin = 1000;
unsigned long imageEnd
End of image presentation within a slide, in milliseconds.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mms.slides[0].imageEnd = 1700;
DOMString audio
File containing the audio.
MMS_MESSAGE_SIZE_EXCEEDED_ERROR if the message size would be exceeded by the adding operation
MMS_VIDEO_SLIDE_ERROR if the slide already includes video part.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mms.slides[0].audio = "grettings.wav";
unsigned long audioBegin
Beginning of audio playback within a slide, in milliseconds.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mms.slides[0].audioBegin = 500;
unsigned long audioEnd
End of audio playback within a slide, in milliseconds.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mms.slides[0].audioEnd = 2000;
DOMString text
Text included in the message.
MMS_MESSAGE_SIZE_EXCEEDED_ERROR if the message size would be exceeded by the adding operation
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mms.slides[0].text = "hi";
unsigned long textBegin
Beginning of text presentation within a slide, in milliseconds.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mms.slides[0].textBegin = 1600;
unsigned long textEnd
End of text presentation within a slide, in milliseconds.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mms.slides[0].textEnd = 2000;
DOMString video
File containing the video
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mms.slides[0].video = "greetings.mpg";
unsigned long videoBegin
Beginning of video presentation within a slide, in milliseconds.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mms.slides[0].videoBegin = 400;
unsigned long videoEnd
End of video presentation within a slide, in milliseconds.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
mms.slides[0].videoEnd = 1200;
MMS
MMS Message API
interface MMS : MMSProperties {
readonly attribute DOMString id;
const unsigned short MULTIPART_MIXED = 0;
const unsigned short MULTIPART_RELATED = 1;
attribute unsigned short messageType;
attribute MMSSlideArray slides;
};
The MMS Message interface provides methods to populate and send a multimedia message.
unsigned short MULTIPART_MIXED
Constant used to identify the type of MMS Message as multipart/mixed.
unsigned short MULTIPART_RELATED
Constant used to identify the type of MMS Message as multipart/related.
readonly
DOMString id
Unique identifier assigned to the message in the platform.
var MMS = bondi.messaging.createMMS(null);
var id = MMS.id;
unsigned short messageType
Type of message: multipart/mixed or multipart/related
MMSSlideArray slides
Actual slides
Email
Email Message API
interface Email : EmailProperties {
readonly attribute DOMString id;
};
The Email Message interface provides methods to populate and send an email message.
readonly
DOMString id
Unique identifier assigned to the message in the platform.
var email = bondi.messaging.createEmail(null);
var id = email.id;
SMSProperties
Properties for SMS creation
[NoInterfaceObject, Callback] interface SMSProperties {
attribute StringArray to;
readonly attribute DOMString from;
readonly attribute Date datetime;
attribute DOMString body;
readonly attribute unsigned short folder;
readonly attribute boolean read;
};
All the attributes are by default, undefined
StringArray to
The list of recipients of the SMS
Array of strings containing the recipients for this message (telephone numbers).
var sms = bondi.messaging.createSMS({to:["+34666666666"],body:"Hello there"});
var recipients = sms.to;
alert(recipients.count + " recipients");
readonly
DOMString from
String containing the phone number origin of the SMS.
var origin = sms.from;
readonly
Date datetime
Object that contains the datetime where the sms was sent or received or created in draft, depending the storage folder.
var sms = bondi.messaging.createSMS(null);
var dateTime = sms.datetime;
DOMString body
String that contains the body of the SMS.
var sms = bondi.messaging.createSMS({to:["+34666666666"],body:"Hello there"});
alert(sms.body);
readonly
unsigned short folder
Integer that indicates the folder in which the message is stored.
var sms = bondi.messaging.createSMS({to:["+34666666666"],body:"Hello there"});
alert(sms.folder);
readonly
boolean read
Value that indicates if the message has been already read
var sms = bondi.messaging.createSMS(null);
var isRead = sms.read;
SMSFilter
Interface used to create Filter objects following the SMSProperties structure.
[NoInterfaceObject] interface SMSFilter : GenericFilter {
};
This interface is intended to be used for input parameters for SMS searching (findSMSs). Interface used for creation of the Filter objects depending on the SMSProperties interface All the attributes are optional and by default are undefined
// Define the success callback.
function successCallback(response) {
var messages = response;
// Get first message in the list of results
var sms = messages[0];
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error code is: " + response.code);
}
// Get the SMSs for the specified filter.
bondi.messaging.findSMSs(successCallback, errorCallback,
[ bondi.messaging.INBOX_FOLDER, bondi.messaging.OUTBOX_FOLDER ],
{ to:"+34666666666", body:"Huesca"});
MMSProperties
Properties for MMS creation
[NoInterfaceObject, Callback] interface MMSProperties {
attribute StringArray to;
attribute StringArray cc;
attribute StringArray bcc;
readonly attribute DOMString from;
attribute DOMString subject;
attribute StringArray attachments;
readonly attribute Date datetime;
attribute DOMString body;
readonly attribute unsigned long folder;
readonly attribute boolean read;
};
All the attributes are by default, undefined
StringArray to
The list of recipients of the MMS
Array of string containing the recipients for this message.
var mms = bondi.messaging.createMMS({to:["+34666666666"], body:"Hello there"});
var recipients = mms.to;
alert(recipients.count + " recipients");
StringArray cc
The list of the recipients of the copy of the MMS
Array of String containing the recipients for this message.
var mms = bondi.messaging.createMMS({cc:["+34666666666"], body:"Hello there"});
var recipients = mms.cc;
alert(recipients.count + " recipients of the copy");
StringArray bcc
The list of the undisclosed recipients of the MMS
Array of strings containing the recipients for this message.
var mms = bondi.messaging.createMMS({bcc:["+34666666666"], body:"Hello there"});
var recipients = mms.bcc;
alert(recipients.count + " undisclosed recipients");
readonly
DOMString from
String containing the phone number origin of the MMS.
var origin = mms.from;
DOMString subject
String with the subject of the MMS
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
alert(mms.subject);
StringArray attachments
The list of paths to the attachments that will be added to this message.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
alert(mms.attachments[0]);
readonly
Date datetime
String that contains the datetime where the MMS was sent or received or created in draft, depending the storage folder.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
var dateTime = mms.datetime;
DOMString body
String that contains the message body.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
alert(mms.body);
readonly
unsigned long folder
Folder where the message is stored.
This value will be one of INBOX_FOLDER, OUTBOX_FOLDER, SENT_FOLDER, DRAFTS_FOLDER defined in MessagingManager.
// Create the message in the Drafts folder.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
alert(mms.folder);
readonly
boolean read
Value that indicates if the message has been already read
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
var isRead = mms.read;
MMSFilter
Interface used to create Filter objects following the MMSProperties structure.
[NoInterfaceObject] interface MMSFilter : GenericFilter {
};
This interface is intended to be used for input parameters for MMS searching (findMMSs). Interface used for creation of the Filter objects depending on the MMSProperties interface All the attributes are optional and by default are undefined
// Define the success callback.
function successCallback(response) {
var messages = response;
// Get first message in the list of results
var mms = messages[0];
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error code is: " + response.code);
}
// Get the MMSs for the specified filter.
bondi.messaging.findMMSs(successCallback, errorCallback,
[bondi.messaging.SENT_FOLDER],
{ to:"+34666666666", body:"Huesca"});
EmailProperties
Properties for Email creation
[NoInterfaceObject, Callback] interface EmailProperties {
attribute StringArray to;
attribute StringArray cc;
attribute StringArray bcc;
readonly attribute DOMString from;
attribute DOMString subject;
attribute StringArray attachments;
readonly attribute Date datetime;
attribute DOMString body;
readonly attribute unsigned long folder;
readonly attribute boolean read;
};
All the attributes are by default, undefined
StringArray to
The list of recipients of the MMS
Array of strings containing the recipients for this message.
var mms = bondi.messaging.createMMS({to:["+34666666666"], body:"Hello there"});
var recipients = mms.to;
alert(recipients.count + " recipients");
StringArray cc
The list of the recipients of the copy of the MMS
Array of strings containing the recipients for this message.
var mms = bondi.messaging.createMMS({cc:["+34666666666"], body:"Hello there"});
var recipients = mms.cc;
alert(recipients.count + " recipients of the copy");
StringArray bcc
The list of the undisclosed recipients of the MMS
Array of string containing the recipients for this message.
var mms = bondi.messaging.createMMS({bcc:["+34666666666"], body:"Hello there"});
var recipients = mms.bcc;
alert(recipients.count + " undisclosed recipients");
readonly
DOMString from
String containing the phone number origin of the MMS.
var origin = mms.from;
DOMString subject
String with the subject of the MMS
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
alert(mms.subject);
StringArray attachments
The list of paths to the attachments that will be added to this message.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
alert(mms.attachments[0]);
readonly
Date datetime
String that contains the datetime where the MMS was sent or received or created in draft, depending the storage folder.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
var dateTime = mms.datetime;
DOMString body
String that contains the message body.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
alert(mms.body);
readonly
unsigned long folder
Folder where the message is stored.
This value will be one of INBOX_FOLDER, OUTBOX_FOLDER, SENT_FOLDER, DRAFTS_FOLDER defined in MessagingManager.
// Create the message in the Drafts folder.
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
alert(mms.folder);
readonly
boolean read
Value that indicates if the message has been already read
var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
var isRead = mms.read;
EmailFilter
Interface used to create Filter objects following the EmailProperties structure.
[NoInterfaceObject] interface EmailFilter : GenericFilter {
};
This interface is intended to be used for input parameters for Email searching (findEmails). Interface used for creation of the Filter objects depending on the EmailProperties interface All the attributes are optional and by default are undefined
// Define the success callback.
function successCallback(response) {
var messages = response;
// Get first message in the list of results
var email = messages[0];
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error code is: " + response.code);
}
// Get the E-mails for the specified filter.
bondi.messaging.findEmails(successCallback, errorCallback,
[ bondi.messaging.INBOX_FOLDER, bondi.messaging.OUTBOX_FOLDER ],
{ from:"+34666666666", body:"Huesca"});
BinarySMSProperties
Options for Binary SMS Message creation
[NoInterfaceObject, Callback] interface BinarySMSProperties {
attribute DOMString to;
attribute ByteArray payload;
readonly attribute unsigned short port;
};
Binary SMS Message is a Short Message within which the TP-User-Data-Header-Indicator (TP-UDHI) bit, as specified in TS 23.040 (http://webstats.3gpp.org/ftp/Specs/html-info/23040.htm), is set to 1 and the The Information Element Identifier octet has the value of 04 (hex) or 05 (hex) indicating 8-bit or 16-bit application port addressing respectively as specified in TS 23.040.
DOMString to
Semicolon (;) separated string containing the recipient addresses
ByteArray payload
String that contains the payload of the Binary message.
The payload attribute of the Binary SMS object contains the TP-User-Data (TP-UD) decoded or encoded based on the TP-Data-Coding-Scheme contained in the message or implemented in the device.
var binary = bondi.messaging.createBinarySMS({to:["+34666666666"],payload:bytes,port:25678});
file.write(binary.payload);
readonly
unsigned short port
Integer that indicates the port to which the Binary message is to be addressed.
var binary = bondi.messaging.createBinarySMS({to:["+34666666666"],payload:bytes,port:25678});
alert(binary.port);
BinarySMS
Binary Message API
interface BinarySMS : BinarySMSProperties {
readonly attribute DOMString id;
};
The Binary Message interface provides methods to populate and send a binary message.
readonly
DOMString id
Unique identifier assigned to the message in the platform.
var binsms = bondi.messaging.createBinarySMS(null);
var id = binsms.id;
BinarySMSFilter
Interface used to create Filter objects following the BinarySMSProperties structure.
[NoInterfaceObject] interface BinarySMSFilter : GenericFilter {
};
This interface is intended to be used for input parameters for SMS searching (findSMSs). Interface used for creation of the Filter objects depending on the SMSProperties interface All the attributes are optional and by default are undefined
// Filter the incoming BinarySMS
bondi.messaging.subscribeToBinarySMS (successCallback, errorCallback,
listener, { from:"+34666666666", port:20000}, true);
MessagingManagerObject
Specifies what is instantiated at feature request
interface MessagingManagerObject {
readonly attribute MessagingManager messaging;
};
Bondi implements MessagingManagerObject;