Provides methods for accessing ArrowDB user objects.
This example creates a new user and checks the response.
Cloud.Users.create({
email: 'test@mycompany.com',
first_name: 'test_firstname',
last_name: 'test_lastname',
password: 'test_password',
password_confirmation: 'test_password'
}, function (e) {
if (e.success) {
var user = e.users[0];
alert('Success:\n' +
'id: ' + user.id + '\n' +
'sessionId: ' + Cloud.sessionId + '\n' +
'first name: ' + user.first_name + '\n' +
'last name: ' + user.last_name);
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example logs a user in and checks the response.
Cloud.Users.login({
login: 'test@mycompany.com',
password: 'test_password'
}, function (e) {
if (e.success) {
var user = e.users[0];
alert('Success:\n' +
'id: ' + user.id + '\n' +
'sessionId: ' + Cloud.sessionId + '\n' +
'first name: ' + user.first_name + '\n' +
'last name: ' + user.last_name);
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example requests information about a user and checks the response.
Cloud.Users.show({
user_id: savedUserInfo.id
}, function (e) {
if (e.success) {
var user = e.users[0];
alert('Success:\n' +
'id: ' + user.id + '\n' +
'first name: ' + user.first_name + '\n' +
'last name: ' + user.last_name);
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example requests information about the currently logged in user and checks the response.
Cloud.Users.showMe(function (e) {
if (e.success) {
var user = e.users[0];
alert('Success:\n' +
'id: ' + user.id + '\n' +
'first name: ' + user.first_name + '\n' +
'last name: ' + user.last_name);
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example requests information about particular users and checks the response.
Cloud.Users.search({
q: 'test'
}, function (e) {
if (e.success) {
alert('Success:\n' +
'Count: ' + e.users.length);
for (var i = 0; i < e.users.length; i++) {
var user = e.users[i];
alert('id: ' + user.id + '\n' +
'first name: ' + user.first_name + '\n' +
'last name: ' + user.last_name);
}
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example requests information about specific users and checks the response.
Cloud.Users.query({
page: 1,
per_page: 10,
where: {
age: { '$gt': 28 },
favorite_color: 'blue',
first_name: 'joe'
}
}, function (e) {
if (e.success) {
alert('Success:\n' +
'Count: ' + e.users.length);
for (var i = 0; i < e.users.length; i++) {
var user = e.users[i];
alert('id: ' + user.id + '\n' +
'first name: ' + user.first_name + '\n' +
'last name: ' + user.last_name);
}
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example updates information about the currently logged in user and checks the response.
Cloud.Users.update({
email: 'joeuser@mycompany.com',
first_name: 'joe',
last_name: 'user',
custom_fields: {
favorite_color: 'blue',
age: 25
}
}, function (e) {
if (e.success) {
var user = e.users[0];
alert('Success:\n' +
'id: ' + user.id + '\n' +
'first name: ' + user.first_name + '\n' +
'last name: ' + user.last_name);
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example logs out the current user and checks the response.
Cloud.Users.logout(function (e) {
if (e.success) {
alert('Success: Logged out');
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example deletes the current user and checks the response.
Cloud.Users.remove(function (e) {
if (e.success) {
alert('Success: Removed');
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example requests a password reset for a user and checks the response.
Cloud.Users.requestResetPassword({
email: 'joeuser@mycompany.com'
}, function (e) {
if (e.success) {
alert('Success: Reset Request Sent');
} 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.
Create a new user.
See Users: Create User for the request parameters supported by this method.
Data is returned in the users
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Log in a user.
See Users: Login User for the request parameters supported by this method.
Data is returned in the users
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Log out the current user.
Requires user login.
See Users: Logout User for the request parameters supported by this method.
Data is returned in the users
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 users with sorting and pagination.
See Users: Custom Query of Users for the request parameters supported by this method.
Data is returned in the users
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Delete the current user.
Requires user login.
See Users: Delete User for the request parameters supported by this method.
Parameters to send in the request.
Callback function to execute when the method completes.
Send an email to user to recover lost password.
See Users: Send a reset password email to User for the request parameters supported by this method.
Data is returned in the users
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Re-send a user verification email.
See Users: Send a reset password email to User for the request parameters supported by this method.
Data is returned in the users
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 users based on the specified search criteria.
See Users: Search Users for the request parameters supported by this method.
Data is returned in the users
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Create a new user using 3-Legged OAuth.
This method has been removed since 3.2.3
OAuth authentication is no longer supported in the ti.cloud module.
Invokes a modal dialog that allows the authentication server to display a web page for creating a new user.
See Authentication for instructions on enabling 3-Legged OAuth for your application.
Authentication data is returned in the parameter passed to the callback.
A dictionary of properties for the request.
Callback function to execute when the method completes.
Log in a user using 3-Legged OAuth.
This method has been removed since 3.2.3
OAuth authentication is no longer supported in the ti.cloud module.
Invokes a modal dialog that allows the authentication server to display a web page for authenticating a user.
See Authentication for instructions on enabling 3-Legged OAuth for your application.
Authentication data is returned in the parameter passed to the callback.
A dictionary of properties for the request.
Callback function to execute when the method completes.
Checks if the user is authenticated with 3-Legged OAuth.
This method has been removed since 3.2.3
OAuth authentication is no longer supported in the ti.cloud module.
True is returned after successfully calling secureCreate or secureLogin, and false after successfully calling logout.
Sets the value of the bubbleParent property.
New value for the property.
Sets the value of the lifecycleContainer property.
New value for the property.
Show public user information.
See Users: Show User Profile for the request parameters supported by this method.
Data is returned in the users
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Show both public and private information about the user currently logged in.
Requires user login.
See Users: Show Current User Profile for the request parameters supported by this method.
Data is returned in the users
property of the parameter passed to the callback.
Callback function to execute when the method completes.
Update the current user.
Requires user login.
See Users: Update Current User for the request parameters supported by this method.
Data is returned in the users
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.