I am stupid Gou. Recently, the company has to develop a mobile app. It is necessary to use Vue combined with the project development of WebPack + ES6. It is necessary to use the instant communication function of Yunyun. I look forward to the mother, I found this type of article. Very few, I also spent a lot of time to figure out how it is what is going on, then talk less nonsense, directly on the code, tell Xiaobai how to operate.
First, you must register, this stupid operation does not say, the registration will get AppKey and the clouds provided token (this token is generally When the backend is returned, we will return to us in the background. It is not our business. If you really want to get through the cloud, I will say it later).
Many beginners beginning of time will not start to see the document around, you will see the following:
See here, of course, we have developed app To use the local document, don’t say, directly open download and look at what ghost, open the directory is as follows,
This is the file we are looking for, we are as long as the latest The version, take these three files, (of course, you can also directly quote the SDK of their outer chain), the outer chain is of course no local.
Next, after we acquired SDK, how to use it, how to put it into our Vue-CLI project combined with our projects, the SDK, the cloud is written by ES5, Next, how do we use it to use the code we write with ES6, here’s official website does not explain.
Let’s put these three pieces into our project, first put the
files under the static directory,
Protobuf-2.2.8.min.js file is placed in the src directory (here you are free, usually in the company’s JS file)
Ok, here, you have seen it, It is here to introduce
rongimlib-2.2.9.min.js This file, here, let us first know how to use this JS file,
We first open the project catalog The lower index.html file
The above is the Vue-CLI access to the cloud to realize instant communication using the Vue-CLI access to the VUE. I hope that if you have any questions, please leave a message, Xiaobian, please Will reply to everyone in time. Thank you very much for your support of Tumi Cloud Website!
If you think this article helps you, welcome to reprint, please indicate the source, thank you!