Messaging

You can use the Application Manager's launch method to bring up the Messaging application into compose/chat view.

The Application Manager's launch method takes an id parameter and a params object:

Syntax

{
    "id"     : string,
    "params" : {
        "attachment" : string,
        "composeRecipients" : 
         [{
            "address"     : string,
            "serviceName" : string
         }],
        "contactPointId"  : string,
        "messageText"     : string,
        "personId"        : string
    }
}                                                       

Parameters

Parameter Required Type Description
id Yes string Set to "com.palm.app.messaging".
attachment No string Path to JPEG file.
composeRecipients No object array An alternative to using personID or contactPointId.
address No string Specifies either the target phone number or the target IM address.
serviceName No string Specifies the IM addressee's service. Valid values are "yahoo", "gmail", and "aol".
contactPointId No string Contact entry ID for the contact method (e.g., mobile phone number, IM address). This applies only to the launched chat view.
Note: You can optionally pass a contactPointId to set the selected transport when you launch the chat.
messageText No string Message contents.
personId No string Contact ID for the recipient. This applies only to the launched chat view.

Examples

luna-send

luna-send -n 1  luna://com.palm.applicationManager/launch '{"id":"com.palm.app.messaging"}'
{ "returnValue": true, "processId": "success" }

Mojo

In this example, the messaging service is called to launch the messaging application. The "To:" field is pre-filled with a Yahoo IM address for "Joe", and a phone number for a second recipient. The message text field is prefilled with "Text of the message".

  this.controller.serviceRequest('palm://com.palm.applicationManager', {
    method: 'launch',
    parameters: {
        id: 'com.palm.app.messaging',
        params: {
                composeRecipients: [
                    {
                        address: "joe",
                        serviceName: "yahoo"
                    },
                    {
                        address: "4085555555"
                    }
                ],
                messageText: 'Text of the message'
            }
        },
    onSuccess: this.handleOKResponse,
    onFailure: this.handleErrResponse
});

Sample Code

See Services Sample.