Bondi logo

The Bondi messaging Module - Version 1.1

February 2010

Authors


Abstract

Send and manage text-, binary and multimedia-messages via Email, SMS, and MMS.

Table of Contents


Summary of Methods

InterfaceMethod
FindSMSsSuccessCallbackvoid onSuccess(SMSArray obj)
FindMMSsSuccessCallbackvoid onSuccess(MMSArray obj)
FindEmailsSuccessCallbackvoid onSuccess(EmailArray obj)
EmailAccountsSuccessCallbackvoid onSuccess(StringArray obj)
SubscriptionSuccessCallbackvoid onSuccess(unsigned long subscriptionID)
OnIncomingSMSvoid onEvent(SMS message)
OnIncomingBinarySMSvoid onEvent(BinarySMS message)
OnIncomingMMSvoid onEvent(MMS message)
OnIncomingEmailvoid onEvent(Email message)
MessagingError
MessagingManagerSMS 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
Email
SMSProperties
SMSFilter
MMSProperties
MMSFilter
EmailProperties
EmailFilter
BinarySMSProperties
BinarySMS
BinarySMSFilter
MessagingManagerObject

1. Introduction

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.

1.1. Feature set

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.

http://bondi.omtp.org/api/1.1/messaging

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

1.2. Features

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

is successfully requested, the interface MessagingManager is instantiated, and the resulting object appears in the global namespace as Bondi.messaging.

http://bondi.omtp.org/api/1.1/messaging.email.send

Call to the sendEmail in the messagingManager

Device capabilities:

  • messaging.email.send
http://bondi.omtp.org/api/1.1/messaging.mms.send

Call to the sendMMS in the messagingManager

Device capabilities:

  • messaging.mms.send
http://bondi.omtp.org/api/1.1/messaging.sms.send

Call to the sendSMS method in the messagingManager

Device capabilities:

  • messaging.sms.send
http://bondi.omtp.org/api/1.1/messaging.binarysms.send

Call to the sendBinary method in the messagingManager

Device capabilities:

  • messaging.binarysms.send
http://bondi.omtp.org/api/1.1/messaging.sms.get

Call to the findSMSs method in the messagingManager

Device capabilities:

  • messaging.sms.get
http://bondi.omtp.org/api/1.1/messaging.mms.get

Call to the findMMSs method in the messagingManager

Device capabilities:

  • messaging.mms.get
http://bondi.omtp.org/api/1.1/messaging.email.get

Call to the findEmails method in the messagingManager

Device capabilities:

  • messaging.email.get
http://bondi.omtp.org/api/1.1/messaging.sms.delete

Call to the deleteSMS method in the messagingManager

Device capabilities:

  • messaging.sms.delete
http://bondi.omtp.org/api/1.1/messaging.mms.delete

Call to the deleteMMS method in the messagingManager

Device capabilities:

  • messaging.mms.delete
http://bondi.omtp.org/api/1.1/messaging.email.delete

Call to the deleteEmail method in the messagingManager

Device capabilities:

  • messaging.email.delete
http://bondi.omtp.org/api/1.1/messaging.email.getAccounts

Call to the getAvailableEmailAccounts method in the messagingManager

Device capabilities:

  • messaging.email.getAccounts
http://bondi.omtp.org/api/1.1/messaging.email.attach

Call to the updateEmail

Device capabilities:

  • messaging.email.attach
  • io.file.read
http://bondi.omtp.org/api/1.1/messaging.mms.attach

Call to the updateMMS

Device capabilities:

  • messaging.mms.attach
  • io.file.read
http://bondi.omtp.org/api/1.1/messaging.sms.subscribe

Call to the subscribeToSMS method

Device capabilities:

  • messaging.sms.subscribe
http://bondi.omtp.org/api/1.1/messaging.mms.subscribe

Call to the subscribeToMMS method

Device capabilities:

  • messaging.mms.subscribe
http://bondi.omtp.org/api/1.1/messaging.email.subscribe

Call to the subscribeToEmail method

Device capabilities:

  • messaging.email.subscribe
http://bondi.omtp.org/api/1.1/messaging.binarysms.subscribe

Call to the subscribeToBinarySMS method

Device capabilities:

  • messaging.binarysms.subscribe

1.3. Device capabilities

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

2. Type Definitions

2.1. SMSArray

Array of SMS.

        typedef sequence<SMS> SMSArray;

2.2. MMSArray

Array of MMS.

        typedef sequence<MMS> MMSArray;

2.3. EmailArray

Array of Email.

        typedef sequence<Email> EmailArray;

2.4. MMSSlideArray

Array of slides

        typedef sequence<MMSSlide> MMSSlideArray;

3. Interfaces

3.1. 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.

Methods

onSuccess

Method invoked when a list of SMSs is retrieved successfully

Signature
void onSuccess(in SMSArray obj);
Parameters
  • obj: The list of SMSs

3.2. 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.

Methods

onSuccess

Method invoked when a list of MMSs is retrieved successfully

Signature
void onSuccess(in MMSArray obj);
Parameters
  • obj: The list of MMSs

3.3. 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.

Methods

onSuccess

Method invoked when a list of e-mails is retrieved successfully

Signature
void onSuccess(in EmailArray obj);
Parameters
  • obj: The list of e-mails

3.4. 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.

Methods

onSuccess

Method invoked when the list of available email accounts is retrieved successfully

Signature
void onSuccess(in StringArray obj);
Parameters
  • obj: Array of strings containing the list of email accounts

3.5. 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.

Methods

onSuccess

Method invoked when subscribing is successful

Signature
void onSuccess(in unsigned long subscriptionID);
Parameters
  • subscriptionID: Identifier of the subscription

3.6. 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);
        };

Methods

onEvent

To be invoked when an application must be notified on an incoming SMS event

Signature
void onEvent(in SMS message);
Parameters
  • message: Reference to the incoming SMS

3.7. 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);
        };

Methods

onEvent

To be invoked when an application must be notified on an incoming Binary Message event

Signature
void onEvent(in BinarySMS message);
Parameters
  • message: Reference to the incoming Binary Message

3.8. 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);
        };

Methods

onEvent

To be invoked when an application must be notified on an incoming MMS event

Signature
void onEvent(in MMS message);
Parameters
  • message: Reference to the incoming MMS

3.9. 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);
        };

Methods

onEvent

To be invoked when an application must be notified on an incoming Email event

Signature
void onEvent(in Email message);
Parameters
  • message: Reference to the incoming Email

3.10. 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;
        };

Constants

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.

3.11. 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.

Constants

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.

Methods

createSMS

Creates an SMS object from the options provided as a parameter.

Signature
SMS createSMS(in SMSProperties options);
Parameters
  • options: Contains the information to create the SMS
Return value
SMS object
Exceptions
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if options is not a valid SMSProperties object

Code example
        var sms = bondi.messaging.createSMS({to:["+34666666666"],body:"Hello there"});
 
createMMS

Creates an MMS object from the options provided as a parameter.

Signature
MMS createMMS(in MMSProperties options);
Parameters
  • options: Contains the information to create the MMS
Return value
MMS object.
Exceptions
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if options is not a valid MMSProperties object

Code example
        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.

Signature
Email createEmail(in EmailProperties options);
Parameters
  • options: Contains the information to create the Email
Return value
Email object.
Exceptions
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if options is not a valid EmailProperties object

Code example
        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

Signature
BinarySMS createBinarySMS(in BinarySMSProperties options);

Creates an Binary object from the options provided as a parameter.

Parameters
  • options: Contains the information to create a BinarySMS
Return value
Binary object.
Exceptions
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if options is not a valid BinarySMSProperties object

Code example
        //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.

Signature
PendingOperation updateSMS(in SuccessCallback successCallback, in ErrorCallback errorCallback, in SMS sms);

Errors that can be returned in the ErrorCallback:

  • DeviceAPIError INVALID_ARGUMENT_ERROR if sms is not a valid SMS object.
  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
Parameters
  • successCallback: function called when the invocation ends successfully.
  • errorCallback: function called when an error occurs, the input parameter "response" is an Error object with string properties "name" and "message" giving information about the type of error that occurred.
  • sms: SMS object containing the message to be updated
Return value
PendingOperation enabling the requester to cancel this request.
Code example
  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.

Signature
PendingOperation updateMMS(in SuccessCallback successCallback, in ErrorCallback errorCallback, in MMS mms);

Errors that can be returned in the ErrorCallback:

  • DeviceAPIError INVALID_ARGUMENT_ERROR if mms is not a valid MMS object.
  • MessagingError MMS_VIDEO_SLIDE_ERROR if the slide already includes image or audio part.
  • MessagingError MMS_MESSAGE_SIZE_EXCEEDED_ERROR if the message size would be exceeded by inclusion of some text or media.
  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
Parameters
  • successCallback: function called when the invocation ends successfully.
  • errorCallback: function called when an error occurs, the input parameter "response" is an Error object with string properties "name" and "message" giving information about the type of error that occurred.
  • mms: MMS object containing the message to be updated
Return value
PendingOperation enabling the requester to cancel this request.
API features
http://bondi.omtp.org/api/1.1/messaging.mms.attach
Code example
  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.

Signature
PendingOperation updateEmail(in SuccessCallback successCallback, in ErrorCallback errorCallback, in Email email);

Errors that can be returned in the ErrorCallback:

  • DeviceAPIError INVALID_ARGUMENT_ERROR if email is not a valid Email object.
  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
Parameters
  • successCallback: function called when the invocation ends successfully.
  • errorCallback: function called when an error occurs, the input parameter "response" is an Error object with string properties "name" and "message" giving information about the type of error that occurred.
  • email: Email object containing the message to be updated
Return value
PendingOperation enabling the requester to cancel this request.
API features
http://bondi.omtp.org/api/1.1/messaging.email.attach
Code example
  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.

Signature
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:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
  • MessagingError OUT_OF_COVERAGE_ERROR when the device is out of network coverage
Parameters
  • successCallback: function called when the invocation ends successfully.
  • errorCallback: function called when an error occurs, the input parameter "response" is an Error object with string properties "name" and "message" giving information about the type of error that occurred.
  • sms: SMS object containing the message to be sent
  • store: Boolean that indicates whether the message is going to be stored in the SENT folder once sent. If false, it will not be possible to contents of the sent message.
Return value
PendingOperation enabling the requester to cancel this request.
API features
http://bondi.omtp.org/api/1.1/messaging.sms.send
Code example
        //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.

Signature
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:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
  • MessagingError OUT_OF_COVERAGE_ERROR when the device is out of network coverage
Parameters
  • successCallback: function called when the invocation ends successfully.
  • errorCallback: function called when an error occurs, the input parameter "response" is an Error object with string properties "name" and "message" giving information about the type of error that occurred.
  • mms: an MMS object containing the message to be sent
  • store: Boolean that indicates whether the message is going to be stored in the SENT folder once sent. If false, it will not be possible to contents of the sent message.
Return value
PendingOperation enabling the requester to cancel this request.
API features
http://bondi.omtp.org/api/1.1/messaging.mms.send
Code example
        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.

Signature
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:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
  • MessagingError OUT_OF_COVERAGE_ERROR when the device is out of network coverage
Parameters
  • successCallback: function called when the invocation ends successfully.
  • errorCallback: function called when an error occurs, the input parameter "response" is an Error object with string properties "name" and "message" giving information about the type of error that occurred.
  • email: an Email object containing the message to be sent
  • store: Boolean that indicates whether the message is going to be stored in the SENT folder once sent. If false, it will not be possible to contents of the sent message.
Return value
PendingOperation enabling the requester to cancel this request.
API features
http://bondi.omtp.org/api/1.1/messaging.email.send
Code example
        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.

Signature
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:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
  • MessagingError OUT_OF_COVERAGE_ERROR when the device is out of network coverage
Parameters
  • successCallback: function called when the invocation ends successfully.
  • errorCallback: function called when an error occurs, the input parameter "response" is an Error object with string properties "name" and "message" giving information about the type of error that occurred.
  • binary: an Binary object containing the bytes to be sent
Return value
PendingOperation enabling the requester to cancel this request.
API features
http://bondi.omtp.org/api/1.1/messaging.binarysms.send
Code example
        // 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

Signature
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:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function If parameters are not valid If folder isn't one of the following: INBOX_FOLDER,SENT_FOLDER, OUTBOX_FOLDER or DRAFTS_FOLDER If some of the filter parameters are not supported
Parameters
  • successCallback: function called when the invocation ends successfully, the response object is used to retrieve the array of SMS objects.
  • errorCallback: function called when an error occurs, the input parameter is an Error object with a code giving information about the type of error that occurred.
  • messageFolders: Array of ints stating in which message folders the web app has to look for messages. It can't be null. Array values must be 0 (INBOX_FOLDER),1 (SENT_FOLDER),2 (OUTBOX_FOLDER) or 3 (DRAFTS_FOLDER).
  • filter: Specifies the conditions to be met by the messages
Return value
PendingOperation in order to cancel the async call.
API features
http://bondi.omtp.org/api/1.1/messaging.sms.get
Code example
        // 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

Signature
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:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function If parameters are not valid If folder isn't one of the following: INBOX_FOLDER,SENT_FOLDER, OUTBOX_FOLDER or DRAFTS_FOLDER If some of the filter parameters are not supported
Parameters
  • successCallback: function called when the invocation ends successfully, use response object to retrieve the array of MMS objects.
  • errorCallback: function called when an error occurs, the input parameter is an Error object with a code giving information about the type of error that occurred.
  • messageFolders: Array of ints stating in which message folders the web app has to look for messages. It can't be null. Array values must be 0 (INBOX_FOLDER),1 (SENT_FOLDER),2 (OUTBOX_FOLDER) or 3 (DRAFTS_FOLDER).
  • filter: Specifies the conditions to be met by the messages
Return value
PendingOperation in order to cancel the async call.
API features
http://bondi.omtp.org/api/1.1/messaging.mms.get
Code example
        // 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

Signature
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:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function If parameters are not valid If folder isn't one of the following: INBOX_FOLDER,SENT_FOLDER, OUTBOX_FOLDER or DRAFTS_FOLDER If some of the filter parameters are not supported
Parameters
  • successCallback: function called when the invocation ends successfully, the response object is used to retrieve the array of Strings containing message IDs.
  • errorCallback: function called when an error occurs, the input parameter is an Error object with a code giving information about the type of error that occurred.
  • messageFolders: Array of Ints stating in which message folders the web app should look for messages.It can't be null. Array values must be 0 (INBOX_FOLDER),1 (SENT_FOLDER),2 (OUTBOX_FOLDER) or 3 (DRAFTS_FOLDER).
  • filter: Specifies the conditions to be met by the messages
Return value
PendingOperation in order to cancel the async call.
API features
http://bondi.omtp.org/api/1.1/messaging.email.get
Code example
        // 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

Signature
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).

Parameters
  • messageFolders: Array of ints describing in which message folders the messages should be counted. The Possible values of the array elements are 0 (INBOX_FOLDER), 1 (SENT_FOLDER), 2 (OUTBOX_FOLDER) and 3 (DRAFTS_FOLDER).
  • unread: Specifies whether the returned number of messages should just consider the unread messages (true) or the total number of messages (false). By default it is set to false.
Return value
The number of messages matching the criteria
Exceptions
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if parameters are not valid

Code example
        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

Signature
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).

Parameters
  • messageFolders: Array of ints describing in which message folders the messages should be counted. The Possible values of the array elements are 0 (INBOX_FOLDER), 1 (SENT_FOLDER), 2 (OUTBOX_FOLDER) and 3 (DRAFTS_FOLDER).
  • unread: Specifies whether the returned number of messages should just consider the unread messages (true) or the total number of messages (false). By default it is set to false.
Return value
The number of messages matching the criteria
Exceptions
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if parameters are not valid

Code example
        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

Signature
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).

Parameters
  • messageFolders: Array of ints describing in which message folders the messages should be counted. The Possible values of the array elements are 0 (INBOX_FOLDER), 1 (SENT_FOLDER), 2 (OUTBOX_FOLDER) and 3 (DRAFTS_FOLDER).
  • unread: Specifies whether the returned number of messages should just consider the unread messages (true) or the total number of messages (false). By default it is set to false.
Return value
The number of messages matching the criteria
Exceptions
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if parameters are not valid

Code example
        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

Signature
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:

  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function, i.e. invalid message identifier.
Parameters
  • successCallback: function called when the invocation completes successfully.
  • errorCallback: function called when an error occurs, the callback provides an input parameter that is an Error object that gives information about the type of error that occurred.
  • messageID: Identifier of the message that is to be deleted
  • folder: SMS folder from which the message should be removed. The possible values are 0 (INBOX_FOLDER), 1 (SENT_FOLDER), 2 (OUTBOX_FOLDER) or 3 (DRAFTS_FOLDER).
Return value
PendingOperation in order to allow cancelling the async call.
API features
http://bondi.omtp.org/api/1.1/messaging.sms.delete
Code example
        // 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

Signature
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:

  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function, i.e. invalid message identifier.
Parameters
  • successCallback: function called when the invocation completes successfully.
  • errorCallback: function called when an error occurs, the callback provides an input parameter that is an Error object that gives information about the type of error that occurred.
  • messageID: Identifier of the message that is to be deleted
  • folder: MMS folder from which the message should be removed. The possible values are 0 (INBOX_FOLDER), 1 (SENT_FOLDER), 2 (OUTBOX_FOLDER) or 3 (DRAFTS_FOLDER).
Return value
PendingOperation in order to allow cancelling the async call.
API features
http://bondi.omtp.org/api/1.1/messaging.mms.delete
Code example
        // 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

Signature
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:

  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function, i.e. invalid message identifier.
Parameters
  • successCallback: function called when the invocation completes successfully.
  • errorCallback: function called when an error occurs, the callback provides an input parameter that is an Error object that gives information about the type of error that occurred.
  • messageID: Identifier of the message that is to be deleted
  • folder: Email folder from which the message should be removed. The possible values are 0 (INBOX_FOLDER), 1 (SENT_FOLDER), 2 (OUTBOX_FOLDER) or 3 (DRAFTS_FOLDER).
Return value
PendingOperation in order to allow cancelling the async call.
API features
http://bondi.omtp.org/api/1.1/messaging.email.delete
Code example
        // 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

Signature
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:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
Parameters
  • successCallback: function called when the invocation ends successfully, use response object to retrieve the array of Strings containing accounts.
  • errorCallback: function called when an error occurs, the callback provides an input parameter that is an Error object that gives information about the type of error that occurred.
Return value
PendingOperation enabling the requester to cancel this request.
API features
http://bondi.omtp.org/api/1.1/messaging.email.getAccounts
Code example
        // 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

Signature
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:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
Parameters
  • successCallback: function called when the invocation ends successfully, use response object to retrieve subscription identifier
  • errorCallback: function called when an error occurs, the callback provides an input parameter that is an Error object that gives information about the type of error that occurred.
  • listener: Function to be invoked when an SMS is received
  • filter: Allows to select some conditions to be met by the SMS. If the conditions are not met, the application will not be notified.
  • exclusive: Allows a widget for requesting exclusive register for the notifications. If set to true no other application could register to these notifications.
Return value
the subscription identifier.
API features
http://bondi.omtp.org/api/1.1/messaging.sms.subscribe
Code example
  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

Signature
void unsubscribeFromSMS(in unsigned long subscriptionID);
Parameters
  • subscriptionID: Subscription identifier
Exceptions
  • SecurityError:
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function

Code example
  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

Signature
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:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
Parameters
  • successCallback: function called when the invocation ends successfully, use response object to retrieve subscription identifier
  • errorCallback: function called when an error occurs, the callback provides an input parameter that is an Error object that gives information about the type of error that occurred.
  • listener: Function to be invoked when a binary message is received
  • filter: Allows to select some conditions to be met by the message. If the conditions are not met, the application will not be notified.
  • exclusive: Allows a widget for requesting exclusive register for the notifications. If set to true no other application could register to these notifications.
Return value
the subscription identifier.
API features
http://bondi.omtp.org/api/1.1/messaging.binarysms.subscribe
Code example
  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

Signature
void unsubscribeFromBinarySMS(in unsigned long subscriptionID);
Parameters
  • subscriptionID: Subscription identifier
Exceptions
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function

Code example
  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

Signature
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:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
Parameters
  • successCallback: function called when the invocation ends successfully, use response object to retrieve subscription identifier
  • errorCallback: function called when an error occurs, the callback provides an input parameter that is an Error object that gives information about the type of error that occurred.
  • listener: Function to be invoked when an MMS is received
  • filter: Allows to select some conditions to be met by the MMS. If the conditions are not met, the application will not be notified.
  • exclusive: Allows a widget for requesting exclusive register for the notifications. If set to true no other application could register to these notifications.
Return value
the subscription identifier.
API features
http://bondi.omtp.org/api/1.1/messaging.mms.subscribe
Code example
  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

Signature
void unsubscribeFromMMS(in unsigned long subscriptionID);
Parameters
  • subscriptionID: Subscription identifier
Exceptions
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function

Code example
  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

Signature
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:

  • SecurityError PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
Parameters
  • successCallback: function called when the invocation ends successfully, use response object to retrieve subscription identifier
  • errorCallback: function called when an error occurs, the callback provides an input parameter that is an Error object that gives information about the type of error that occurred.
  • listener: Function to be invoked when an e-mail is received
  • filter: Allows to select some conditions to be met by the e-mail. If the conditions are not met, the application will not be notified.
  • exclusive: Allows a widget for requesting exclusive register for the notifications. If set to true no other application could register to these notifications.
Return value
the subscription identifier.
API features
http://bondi.omtp.org/api/1.1/messaging.email.subscribe
Code example
  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

Signature
void unsubscribeFromEmail(in unsigned long subscriptionID);
Parameters
  • subscriptionID: Subscription identifier
Exceptions
  • DeviceAPIError:

    INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function

Code example
  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);

 

3.12. SMS

SMS Message API

        interface SMS : SMSProperties {

                readonly attribute DOMString id;

        };

The SMS Message interface provides methods to populate and send a message.

Attributes

readonly DOMString id

The unique identifier assigned to the message in the platform.

This is a readonly property.

Code example
        var sms = bondi.messaging.createSMS();
  bondi.messaging.updateSMS(sms);
        var id = sms.id;
 

3.13. 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."

Attributes

unsigned long duration

Duration of the slide presentation, in milliseconds.

Code example
  var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
  mms.slides[0].duration = 3000;
 
DOMString image

File containing an image.

  • MessagingError:

    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.

  • Code example
      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.

    Code example
      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.

    Code example
      var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
      mms.slides[0].imageEnd = 1700;
     
    DOMString audio

    File containing the audio.

  • MessagingError:

    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.

  • Code example
      
      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.

    Code example
      
      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.

    Code example
      var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
      mms.slides[0].audioEnd = 2000;
     
    DOMString text

    Text included in the message.

  • MessagingError:

    MMS_MESSAGE_SIZE_EXCEEDED_ERROR if the message size would be exceeded by the adding operation

  • Code example
      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.

    Code example
      
      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.

    Code example
      var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
      mms.slides[0].textEnd = 2000;
     
    DOMString video

    File containing the video

    Code example
      
      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.

    Code example
      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.

    Code example
      var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there"});
      mms.slides[0].videoEnd = 1200;
     

    3.14. 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.

    Constants

    unsigned short MULTIPART_MIXED

    Constant used to identify the type of MMS Message as multipart/mixed.

    Constant used to identify the type of MMS Message as multipart/related.

    Attributes

    readonly DOMString id

    Unique identifier assigned to the message in the platform.

    Code example
            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

    3.15. Email

    Email Message API

            interface Email : EmailProperties {
    
                    readonly attribute DOMString id;
    
    
            };

    The Email Message interface provides methods to populate and send an email message.

    Attributes

    readonly DOMString id

    Unique identifier assigned to the message in the platform.

    Code example
            var email = bondi.messaging.createEmail(null);
            var id = email.id;
     

    3.16. 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

    Attributes

    StringArray to

    The list of recipients of the SMS

    Array of strings containing the recipients for this message (telephone numbers).

    Code example
            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.

    Code example
            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.

    Code example
            var sms = bondi.messaging.createSMS(null);
            var dateTime = sms.datetime;
     
    DOMString body

    String that contains the body of the SMS.

    Code example
            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.

    Code example
            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

    Code example
            var sms = bondi.messaging.createSMS(null);
            var isRead = sms.read;
     

    3.17. 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

    Code example
            // 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"});
     

    3.18. 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

    Attributes

    StringArray to

    The list of recipients of the MMS

    Array of string containing the recipients for this message.

    Code example
            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.

    Code example
            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.

    Code example
            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.

    Code example
            var origin = mms.from;
     
    DOMString subject

    String with the subject of the MMS

    Code example
            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.

    Code example
            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.

    Code example
            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.

    Code example
            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.

    Code example
      // 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

    Code example
            var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
            var isRead = mms.read;
     

    3.19. 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

    Code example
            // 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"});
     

    3.20. 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

    Attributes

    StringArray to

    The list of recipients of the MMS

    Array of strings containing the recipients for this message.

    Code example
            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.

    Code example
            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.

    Code example
            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.

    Code example
            var origin = mms.from;
     
    DOMString subject

    String with the subject of the MMS

    Code example
            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.

    Code example
            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.

    Code example
            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.

    Code example
            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.

    Code example
      // 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

    Code example
            var mms = bondi.messaging.createMMS({to:["+34666666666"], subject:"Hello there", body:"How Are You?", attachments:["\myPicture.jpg"]});
            var isRead = mms.read;
     

    3.21. 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

    Code example
            // 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"});
     

    3.22. 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.

    Attributes

    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.

    Code example
            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.

    Code example
            var binary = bondi.messaging.createBinarySMS({to:["+34666666666"],payload:bytes,port:25678});
            alert(binary.port);
     

    3.23. BinarySMS

    Binary Message API

            interface BinarySMS : BinarySMSProperties {
    
                    readonly attribute DOMString id;
    
            };

    The Binary Message interface provides methods to populate and send a binary message.

    Attributes

    readonly DOMString id

    Unique identifier assigned to the message in the platform.

    Code example
            var binsms = bondi.messaging.createBinarySMS(null);
            var id = binsms.id;
     

    3.24. 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

    Code example
            // Filter the incoming BinarySMS
            bondi.messaging.subscribeToBinarySMS (successCallback, errorCallback,
                            listener, { from:"+34666666666", port:20000}, true);
     

    3.25. MessagingManagerObject

    Specifies what is instantiated at feature request

            interface MessagingManagerObject {
                    readonly attribute MessagingManager messaging;
            };
            Bondi implements MessagingManagerObject;