Ready to work
1. Click to view related documents directly:
2. Customer account (administrator account)
3. A blank HTML page
- If you do not know how to write can jump directly here
4. Install Local Server
- Local installation of NPM , the direct input terminal
npm install -g http-server
, and then can be run directly at the root levelhttp-server
, resulting in a browser address to open, can be local test - Local install WampServer , according to documents directly installed after the completion of startup files to the www directory, you can directly access directly in the browser localhost
Integration
- After the successful landing customer account, switch to an administrator mode - Channel Management - the phone app to quickly create an association, there will be information appkey, client_id, client_secret, IM and other services for the registered account number
to obtain appkey DNS list , you can use this link:
HTTP : //rs.easemob.com/easemob/server.xml app_key = orgName% 23appName? - In the channel management - web pages, add a plug-in
or will directly use the default plug-ins, and then specify the associated plug-in directly and save
- Integrated systems require users registered IM account , you can use the code simulation httpclient request, you can use google plug Postman , mac terminal registration, get a username and password
- Open a blank HTML, then the page web user channels integrated system will copy the code directly into HTML
and then open the terminal, enterhttp-server
, and then copy the return address to open the browser
to locate the file click
- It says that username / password authentication, where the said username / token verification, according to the document acquired administrator token , the get token acquired url, then in accordance with the request body document body:
{
"grant_type":"client_credentials",
"client_id":"YXA6wDs-MARqEeSO0VcBzaqg11",
"client_secret":"YXA6JOMWlLap_YbI_ucz77j-4-mI0dd"
}
Change
{
"grant_type":"password",
"username":"easemobtest",
"password":"123456"
}
Get user token to go
get token to the user, to go to user authentication parameters
user: {
username: 'easemobtest',
token: 'YWMt-TPQqrKDEeinFVc2g1Rqh2oLp-DVnRHnnosL3QeejzZrpVGqsn4R6K8Dg-6-Fz8WAwMAAAFls3QCgBPGgAd-QhpC1ZW-3nH8sMbnTWLgV6cl9csFRPxeANB8u9lBg'
}