Provides methods for accessing ArrowDB chat messages.
This example sends a chat message to a list of users and checks the response.
Cloud.Chats.create({
to_ids: ids.join(','),
message: 'Good morning'
}, function (e) {
if (e.success) {
for (var i = 0; i < e.chats.length; i++) {
var chat = e.chats[i];
alert('Success:\n' +
'From: ' + chat.from.first_name + ' ' + chat.from.last_name + '\n' +
'Updated: ' + chat.updated_at + '\n' +
'Message: ' + chat.message);
}
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example requests a list of chat messages and checks the response.
Cloud.Chats.query({
participate_ids: ids.join(','),
where: {
updated_at: { '$gt': last_update_time }
}
}, function (e) {
if (e.success) {
for (var i = 0; i < e.chats.length; i++) {
var chat = e.chats[i];
alert('Success:\n' +
'From: ' + chat.from.first_name + ' ' + chat.from.last_name + '\n' +
'Updated: ' + chat.updated_at + '\n' +
'Message: ' + chat.message);
}
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example requests a lists of chat groups that the current user belongs to and checks the response.
Cloud.Chats.getChatGroups(function (e) {
if (e.success) {
for (var i = 0; i < e.chats.length; i++) {
var group = e.chat_groups[i];
alert('Success:\n' +
'id: ' + group.id + '\n' +
'created_at: ' + group.created_at + '\n' +
'number of users: ' + group.participate_users.length);
}
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
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
.
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
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.
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.
A dictionary of properties to apply.
Send a chat message to another user or a group of users.
Requires user login.
See Chats: Create a Chat Message for the request parameters supported by this method.
Data is returned in the chats
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Retrieve a list of chat groups the current user belongs to.
Requires user login.
See Chats: List Chat Groups for the request parameters supported by this method.
Data is returned in the chat_groups
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Retrieve a list of chat messages with sorting and pagination.
Requires user login.
See Chats: Custom Query Chat Messages for the request parameters supported by this method.
Data is returned in the chats
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Retrieve a list of chat groups with sorting and pagination.
Requires user login.
See Chats: Query Chat Groups for the request parameters supported by this method.
Data is returned in the chat_groups
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Deletes a chat message.
Requires user login.
See Chats: Delete a Chat Message for the request parameters supported by this method.
Parameters to send in the request.
Callback function to execute when the method completes.
Sets the value of the bubbleParent property.
New value for the property.
Sets the value of the lifecycleContainer property.
New value for the property.