Modules.Cloud.Messages
> Modules.Cloud.Messages

Provides methods for accessing ArrowDB messages.

Examples

Create Message

This example creates a new message and checks the response.

Cloud.Messages.create({
    to_ids: toSet.ids.join(','),
    body: 'Hello World',
    subject: 'Test Message'
}, function (e) {
    if (e.success) {
        var message = e.messages[0];
        alert('Success:\n' +
            'id: ' + message.id + '\n' +
            'subject: ' + message.subject + '\n' +
            'body: ' + message.body + '\n' +
            'updated_at: ' + message.updated_at);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Reply to a Message

This example replies to a message and checks the response.

Cloud.Messages.reply({
    message_id: savedMessageId,
    body: 'Welcome'
}, function (e) {
    if (e.success) {
        var message = e.messages[0];
        alert('Success:\n' +
            'id: ' + message.id + '\n' +
            'subject: ' + message.subject + '\n' +
            'body: ' + message.body + '\n' +
            'updated_at: ' + message.updated_at);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Show a Message

This example retrieves information about a message and checks the response.

Cloud.Messages.show({
    message_id: savedMessageId
}, function (e) {
    if (e.success) {
        var message = e.messages[0];
        alert('Success:\n' +
            'id: ' + message.id + '\n' +
            'subject: ' + message.subject + '\n' +
            'body: ' + message.body + '\n' +
            'updated_at: ' + message.updated_at);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Show Inbox Messages

This example requests a list of messages in the inbox and checks the response.

Cloud.Messages.showInbox(function (e) {
    if (e.success) {
        alert('Success:\n' +
            'Count: ' + e.messages.length);
        for (var i = 0; i < e.messages.length; i++) {
            var message = e.messages[i];
            alert('Success:\n' +
                'id: ' + message.id + '\n' +
                'subject: ' + message.subject + '\n' +
                'body: ' + message.body + '\n' +
                'updated_at: ' + message.updated_at);
        }
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Show Sent Messages

This example requests a list of messages that have been sent and checks the response.

Cloud.Messages.showSent(function (e) {
    if (e.success) {
        alert('Success:\n' +
            'Count: ' + e.messages.length);
        for (var i = 0; i < e.messages.length; i++) {
            var message = e.messages[i];
            alert('Success:\n' +
                'id: ' + message.id + '\n' +
                'subject: ' + message.subject + '\n' +
                'body: ' + message.body + '\n' +
                'updated_at: ' + message.updated_at);
        }
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Show Message Threads

This example requests a list of message threads and checks the response.

Cloud.Messages.showThreads(function (e) {
    if (e.success) {
        alert('Success:\n' +
            'Count: ' + e.messages.length);
        for (var i = 0; i < e.messages.length; i++) {
            var message = e.messages[i];
            alert('Success:\n' +
                'id: ' + message.id + '\n' +
                'thread id: ' + message.thread_id + '\n' +
                'subject: ' + message.subject + '\n' +
                'body: ' + message.body + '\n' +
                'updated_at: ' + message.updated_at);
        }
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Show Thread Messages

This example requests a list of messages in a thread and checks the response.

Cloud.Messages.showThread({
    thread_id: savedThreadId
}, function (e) {
    if (e.success) {
        alert('Success:\n' +
            'Count: ' + e.messages.length);
        for (var i = 0; i < e.messages.length; i++) {
            var message = e.messages[i];
            alert('Success:\n' +
                'id: ' + message.id + '\n' +
                'thread id: ' + message.thread_id + '\n' +
                'subject: ' + message.subject + '\n' +
                'body: ' + message.body + '\n' +
                'updated_at: ' + message.updated_at);
        }
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Remove a Message

This example deletes a message and checks the response.

Cloud.Messages.remove({
    message_id: savedMessageId
}, function (e) {
    if (e.success) {
        alert('Removed');
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Remove Thread Messages

This example deletes all messages in a thread and checks the response.

Cloud.Messages.removeThread({
    thread_id: savedThreadId
}, function (e) {
    if (e.success) {
        alert('Removed');
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});
  • 0.8
  • 0.8
  • 0.8
Defined By

Properties

apiName : Stringreadonly

The name of the API that this proxy corresponds to.

The name of the API that this proxy corresponds to.

The value of this property is the fully qualified name of the API. For example, Button returns Ti.UI.Button.

  • 3.2.0
  • 3.2.0
  • 3.2.0
Indicates if the proxy will bubble an event to its parent. ...

Indicates if the proxy will bubble an event to its parent.

Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.

Default: true

  • 3.0.0
  • 3.0.0
  • 3.0.0

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.

  • 3.6.0
Defined By

Methods

Applies the properties to the proxy. ...

Applies the properties to the proxy.

Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • props : Dictionary

    A dictionary of properties to apply.

Returns

  • void
Modules.Cloud.Messages
( parameters, callback )
Create a message. ...

Create a message.

Requires user login.

See Messages: Send a Message for the request parameters supported by this method.

Data is returned in the messages property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudMessagesResponse>

    Callback function to execute when the method completes.

Returns

  • void
Gets the value of the apiName property. ...

Gets the value of the apiName property.

  • 3.2.0
  • 3.2.0
  • 3.2.0

Returns

  • String
Gets the value of the bubbleParent property. ...

Gets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Returns

  • Boolean
Gets the value of the lifecycleContainer property. ...

Gets the value of the lifecycleContainer property.

  • 3.6.0

Returns

Modules.Cloud.Messages
( parameters, callback )
Delete a message. ...

Delete a message.

Requires user login.

See Messages: Delete a Message for the request parameters supported by this method.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudMessagesResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Messages
( parameters, callback )
Delete all messages in a thread. ...

Delete all messages in a thread.

Requires user login.

See Messages: Delete All Messages in a Thread for the request parameters supported by this method.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudMessagesResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Messages
( [parameters], callback )
Reply to all recipients of a message. ...

Reply to all recipients of a message.

See Messages: Reply to a Message for the request parameters supported by this method.

Data is returned in the messages property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary (optional)

    Parameters to send in the request.

  • callback : Callback<CloudMessagesResponse>

    Callback function to execute when the method completes.

Returns

  • void
Sets the value of the bubbleParent property. ...

Sets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • bubbleParent : Boolean

    New value for the property.

Returns

  • void
Sets the value of the lifecycleContainer property. ...

Sets the value of the lifecycleContainer property.

  • 3.6.0

Parameters

Returns

  • void
Modules.Cloud.Messages
( parameters, callback )
Retrieve information about a message. ...

Retrieve information about a message.

See Messages: Show a Message for the request parameters supported by this method.

Data is returned in the messages property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudMessagesResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Messages
( parameters, callback )
Retrieve a list of messages in the current user's inbox. ...

Retrieve a list of messages in the current user's inbox.

See Messages: Show User's Inbox Messages for the request parameters supported by this method.

Data is returned in the messages property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudMessagesResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Messages
( parameters, callback )
Retrieve a list of messages in the current user's inbox. ...

Retrieve a list of messages in the current user's inbox.

See Messages: Show User's Sent Messages for the request parameters supported by this method.

Data is returned in the messages property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudMessagesResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Messages
( parameters, callback )
Retrieve a list of messages in a thread from the current user's inbox. ...

Retrieve a list of messages in a thread from the current user's inbox.

See Messages: Show Messages in a Thread for the request parameters supported by this method.

Data is returned in the messages property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudMessagesResponse>

    Callback function to execute when the method completes.

Returns

  • void
Modules.Cloud.Messages
( parameters, callback )
Retrieve a list of message threads in the current users' inbox. ...

Retrieve a list of message threads in the current users' inbox.

See Messages: Show User's Message Threads for the request parameters supported by this method.

Data is returned in the messages property of the parameter passed to the callback.

Parameters

  • parameters : Dictionary

    Parameters to send in the request.

  • callback : Callback<CloudMessagesResponse>

    Callback function to execute when the method completes.

Returns

  • void