The introduction of electron-vue into cloud fusion WebIMSdk failed to connect?

I want to develop a desktop version of Electron chat application through the integration of cloud-based IM desktop application solutions.

1. After initializing the electron-vue project, introduce fused cloud WebIMSDK (RongIMLib-2.3.2.js)
2 into index.ejs, initialize
3 according to the initialization method startInit in fused cloud demo, initialize the method, print RongIMLib and RongIMClient objects have values, but there is no method to start the connection with RongIMClient.connect, and there is no error message

We have created a new web project of vue-cli scaffolding, introduced RongIMLib-2.3.2.js, into index.html and implemented the initialization method of startInit. Running the program prompts us to connect successfully, and executing RongIMClient.connect, indicates that SDK has been correctly integrated

.

question: why did the integration fail in the electron-vue project?

which boss has encountered this kind of integration problem, please give me a lot of advice!

Apr.11,2021

have you solved it?


encountered the same problem and studied it all morning (without taking a nap)

in fact, the main reason why the communication between electron-vue and cannot be linked is that electron, rather than vue, is a bit troublesome. I can roughly talk to you about the problem: because Electron integrates Node.js, and its module, exports,. These three of require and Rongyun itself conflict with the operation of DOM, so the connection of Rongyun cannot follow the normal mode, but can be solved through the require plug-in and the combination of protobuf (these two modules are available in the official demo, and there are also examples of solutions (there are electron , electron-vue , then you need to change the code), that is, the example is a bit crappy, and some of the code needs to be changed. It's still a little sloppy to do things with cloud technology documents.

http://www.rongcloud.cn/docs/.

Menu