npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

im_electron_sdk

v8.0.5906

Published

tencent cloud im for electron base c++ apis.

Downloads

588

Readme

Electron SDK for Tencent Cloud Chat

more Languages : English | 简体中文

About Tencent Cloud Chat

Tencent Cloud Chat provides globally interconnected chat APIs, multi-platform SDKs, and UIKit components to help you quickly bring messaging capabilities such as one-to-one chat, group chat, chat rooms, and system notifications to your applications and websites.

Through the official electron SDK im_electron_sdk, you can efficiently integrate real-time chat into your client app.

You can sign up for a Tencent Cloud account at here.

Explore more docs about Tencent Cloud Chat.

Commonly Used Scenarios

  • Online Customer Service

    <img src="https://cloudcache.intl.tencent-cloud.com/cms/backend-cms/L7Q6912_%E5%9C%A8%E7%BA%BF%E5%AE%A2%E6%9C%8D%402x.jpg"" width="730" height="410" data-canonical-src="https://cloudcache.intl.tencent-cloud.com/cms/backend-cms/L7Q6912_%E5%9C%A8%E7%BA%BF%E5%AE%A2%E6%9C%8D%402x.jpg" style="max-width: 100%;">

  • OA

  • Interactive Live Streaming

  • Social Messaging

  • Influencer Marketing

  • Interactive Game

  • Online Education

  • Online Healthcare

  • Meeting

  • Smart Device

  • Private Cloud Deployment

Experience Demo

You can experience our Chat and Voice/Video Call modules via the following demo. The following demos have been build by the same Electron project with our SDKs and extensions. You can download and experience our SDKs by demo.

Or you can download Demo from Git and run demo:

git clone https://github.com/tencentyun/im_electron_demo.git

Environmental requirements

|Platform|Version| |---|---| |Electron|13.1.5 and above| |Node.js|v14.2.0 and above|

Choose the appropriate method to integrate Electron SDK

IM Electron SDK provides two ways to integrate, you can choose the most suitable scheme to integrate:

|Inheritance method| Applicable scenarios| |---|---| |Using DEMO| IM Demo contains complete chat functions, and the code is open source. If you need to implement chat-like scenarios, you can use Demo for secondary development. You can try Demo now. | |Self-implementation |This method can be used if the Demo cannot meet the functional interface requirements of your application. | To help you better understand the various APIs of the IM SDK, we also provide API documents.

Installation

  npm install im_electron_sdk --save

Prerequisites

Getting started

1. Generate UserSig UserSig is a password used to log in to Tencent Cloud Chat. It is the ciphertext obtained after data such as UserID is encrypted. In the IM console, select your application and click Auxiliary Tools > UserSig Generation & Verification on the left sidebar. Create UserID and corresponding UserSig, and copy the UserID, Key, and UserSig for subsequent logins.

2. Get Started

// main process
const TimMain = require('im_electron_sdk/dist/main')

const sdkappid = 0;// Replace `0` with the `SDKAppID` of your chat app during access.
const tim = new TimMain({
  sdkappid:sdkappid
})

// render process
const TimRender = require('im_electron_sdk/dist/render')
const timRender = new TimRender();
// Initialize
timRender.TIMInit()
// Login
timRender.TIMLogin({
  userID:"userID",
  userSig:"userSig" // see Generate UserSig
}).then(()=>{
  // success
}).catch(err=>{
  // error
})
// other api

Sending your first message

1. Login in to the Chat SDK

timRender.TIMLogin({
  userID:"userID",
  userSig:"userSig" // see Generate UserSig
}).then(()=>{
  // success
}).catch(err=>{
  // error
})

2. Send message The following shows how to send simple text messages. You can also send different types of messages(Image, Voice, Short Video, Location, Custom etc.).For more imformation, see Docs.

let param:MsgSendMessageParamsV2 = {
    conv_id: "conv_id",
    conv_type: 1, // see enum [TIMConvType] in Docs
    params: {
        message_elem_array: [{
            elem_type: 0, // see enum [TIMElemType] in Docs
            text_elem_content:'Hello Tencent!',
        }],
    },
    callback: (data) => {}
  }
let data = await timRender.TIMMsgSendMessageV2(param); // if(data.code == 0),success

3. Get Conversation List After Successfully send message, message will appear in conversation. The following shows how to get conversation list.

let param:getConvList = {
    userData:'',
  }
let {code,json_params} = await timRenderInstance.TIMConvGetConvList(param)
if(code == 0){
  // success. Conversation list is in "json_params"
}

Get message List Common application scenarios are:

  1. After the interface enters a new conversation, it first requests a certain number of historical messages at one time to display the list of historical messages.
  2. Monitor long links, receive new messages in real time, and add them to the historical message list.

One-time request history message list:

let param:MsgGetMsgListParams = {
        conv_id: conv_id,
        conv_type: conv_type,
        params: {
            msg_getmsglist_param_last_msg: msg,
            msg_getmsglist_param_count: 20,
            msg_getmsglist_param_is_remble: true,
        },
        user_data: user_data
    }
    let msgList:commonResult<Json_value_msg[]> = await timRenderInstance.TIMMsgGetMsgList(param);

monitoring new messages by callback binding callback:

let param : TIMRecvNewMsgCallbackParams = {
            callback: (...args)=>{},
            user_data: user_data
        }
timRenderInstance.TIMAddRecvNewMsgCallback(param);

At this point, you have basically completed the basic development of the IM messaging module, you can send and receive messages, and you can also enter different conversations. You can continue to complete the development of related functions such as groups, user profiles, relationship chains, offline push, and local search. For more information,see Docs

Enrich IM experience with more plugins In addition to the basic functions of the SDK, we also provide optional plugins to help you enrich your IM capabilities.

API Docs & Changelogs

If you want to find out more api docs about im_electron_sdk, go to Docs.

If you want to check the record of SDK versions, go to Change Log.

Supported Platform

Windows、Mac、Linux(uos)

Tencent Cloud Instant Messaging Chat Electron API

Based on Tencent Cloud instant messaging IM cross-platform C interface encapsulation, the interface is consistent with the C interface.

Notice

  1. Multiple rendering processes using sdk cannot initialize and login repeatedly.

FAQ

  • Projects built with vue-cli-plugin-electron-builder use native modules, see No native build was found for platform = xxx
  • Projects built with webpack using native modules, see FAQ for Windows
  • Dynamic Linking Error. electron-builder configure
     extraFiles:[
      {
        "from": "./node_modules/im_electron_sdk/lib/",
        "to": "./Resources",
        "filter": [
          "**/*"
        ]
      }
    ]

API List

Document

About Document

  • The manger/xxx on the right is the documentation for each API
  • The interface/xxx on the right is the interface of each API method, and there are reminders for each parameter

Others

Underlying SDK Version:mac(6.7)、windows(6.7)、Linux(6.7)