User Account Management For Mobile Apps
We’re pleased to announce a dedicated set of tools for managing user accounts on all apps developed using our platform. All examples in this tutorial use the CloudMine iOS SDK, however, all of the operations are also available through our REST API.
The CMUser class contains all the methods you need to manage user accounts. To create a new account, initialize a new CMUser object and call the createAccountWithCallback method.
Once the account is created, the user can be authenticated by calling the loginWithCallback method.
There is a shortcut for creating an account and logging in with one operation called createAccountAndLoginWithCallback:
Once the user is logged in, you will need to configure the CMStore for making authenticated requests.
From now on, all requests for user-level data will be authenticated with the user’s credentials.
When you want to terminate a user’s session, call the logoutWithCallback method.
Users now have the ability to change their password. For security purposes, the user must provide their old password along with their new password.
Forgotten Password Reset
If a user forgets their password, they can request that an email be sent with instructions on how to reset it.
How to Store and Retrieve User Data
There are many different methods for retrieving data from the CMStore. Each method has two versions: one to fetch app-level data, and one for user-level data. To store or retrieve user objects, call the “user” version of any method in CMStore: as long as the CMStore has been initialized with a logged-in user, requests will transparently be authenticated with that user.
For example, to retrieve all user objects, call the allUsersObjectsWithOptions method.
For more information, visit our iOS Library Documentation.