iOS Cloud usage rationale

Source: Internet
Author: User

App Key/secretapp Key/secret is the equivalent of your app's account and password for cloud. is the necessary identity for the cloud SDK to connect to the server, and each app corresponds to a set of app Key/secret. The cloud provides two sets of environments, development environments and production environments that are easy for you to integrate and test, which is the business environment that is truly operational after the APP is online. Data isolation between the two to avoid conflicting development environment data and online production environment data. For the developer's production environment and development environment, we provide two sets of App Key/secret,在正式上线前,请务必切换到生产环境。 Tokentoken is the user token, which is the equivalent of the current user connection to the cloud on your app. Each user connects to a server that requires a token, and a replacement token is required for the user to replace it. Each time you initialize a connection server, you need to submit tokens to the server. So why is the server going to get tokens? Because in exchange for token need to provide app key and app Secret, request token on the client, your client code once be decompile, will cause your app key and app Secret leak. Therefore, be sure to exchange tokens on the service side. Get token client to register the account password to the server, the server with this account password to cloud Server registration, the cloud server will return a token to the app service side, then this token is representative of a cloud users.

Become a cloud user so this time the app's server has the client's account and password, and the cloud returns the token, the server will save the client's account and password to the database, and will return token to the client. At this end, the app client becomes a cloud user and can use this token to connect to a cloud-connected server. Other client users also become cloud users in the same way. At this point the app's server has information about the client user

Send a message to a friend 1. Add friends when the user of our client has always been user two to send a message, in fact, the cloud server is not aware of user one and user two is a friend relationship, it also regardless of whether the two users are friends, then why the inexplicable two users can send messages to each other? So this is connected by token and UserID. User one by calling Add Friends API Add users two friends, user two agreed, user one's friend list has user two information, including token associated UserID

2. Send the message in fact, the communication between the client, the app's server is not aware of the content of this, if the app service needs to save the user's information that needs to be paid to the cloud, the cloud has a message routing function, is sent to the client and also send the message to the app's service side for saving. When the user always sends a message to user two, the cloud is identified by the user's Token-userid, and the information is forwarded to a specific user.

iOS Cloud usage rationale

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.