Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Getting Started

Updated on 2024-12-27 GMT+08:00

Before integrating the Electron SDK into a third-party application, familiarize yourself with the basic process of integrating the Huawei Cloud Meeting Electron SDK into an Electron client by referring to Building the Electron Demo.

To integrate Huawei Cloud Meeting Electron SDK into a third-party Electron client, perform the following steps:

  1. Download the Electron SDK.
  2. Decompress the Electron SDK to obtain the following directories and files.

    Figure 1 Directory structure of the SDK package

    NOTE:

    1. If the macOS platform is used, decompress the Electron SDK on the macOS computer. Or, the framework will be damaged and the SDK cannot be used.

  3. Copy Electron SDK files.

    NOTE:

    1. If Node.js has been installed, run the following command to check the Node.js version. The result x64 indicates 64-bit and ia32 indicates 32-bit.

    $ node -p "process.arch"

    2. If Node.js is not installed, download the required version from the Node.js website.

    • If the platform is Windows and the Node.js version is 32-bit, run the run_demo_win32.bat script in the directory generated after decompression in the preceding step.
    • If the platform is Windows and the Node.js version is 64-bit, run the run_demo_x64.bat script in the directory generated after decompression in the preceding step.
    • On a Mac with an Intel chip, run the run_demo_mac.sh script in the directory generated after decompression in the preceding step.
    • On a Mac with an M-series chip, run the run_demo_mac_arm64.sh script in the directory generated after decompression in the preceding step.
    NOTE:

    The .bat or .sh script can perform the following operations:

    • Compile TS APIs and generate JS and types files.
    • Copy the SDK files of the corresponding platform to the corresponding directory (sdk/win32, sdk/x64, or sdk/mac).
    • Run the demo.
    • Copy the js and types directories and their subdirectories and files and the package.json file in the root directory to a directory of the project. (If the project uses TypeScript, copy the ts directory and its subdirectories and files.)
      NOTE:

      The JavaScript APIs to be called are stored in the js folder, and the entry file is js\index.js. (If the project uses TypeScript, the entry file is ts\index.ts.)

  4. Add dependencies.

    Add dependencies by referring to the package.json file in the demo.

    1
    2
    3
    "dependencies": {
        "electron": "^13.6.7"
    },
    

  5. Use the import mode to reference the directory where API files of the Electron SDK are located, initialize the UISDKService object, and configure the node path to load the SDK.

    Refer to the AppService.js/NotifyService.js code in the demo.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    import UISDKService from 'hwmsdk-electron';
    const os = window.require('os');
    const platform = os.platform();
    const arch = os.arch();
    const path = window.require("path");
    
    let instance = null;
    export default class ApiService {
      constructor() {
        if (!instance) {
          instance = this;
          // Pass the actual node path to the UISDKService constructor.
          let _path = (platform == 'darwin' ? './../sdk/mac/' : arch == 'x64' ? './../sdk/x64/' : './../sdk/win32/');
          let nodePath = path.join(window.__dirname, (_path + "HwmUisdk.node"));
          console.log("ApiService nodePath", nodePath);
          this.uisdkService = new UISDKService(nodePath);
        }
        return instance;
      }
    }
    

  6. Call APIs.

    For details about the API calling and message notification processing sequence of Huawei Cloud Meeting, see API Call in Typical Scenarios.

    JavaScript APIs that can be called by third-party applications are stored in js/api/. You can call these APIs by referring to AppService/ApiService.js in the demo.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    import UISDKService from 'hwmsdk-electron';
    const os = window.require('os');
    const platform = os.platform();
    const arch = os.arch();
    const path = window.require("path");
    
    let instance = null;
    export default class ApiService {
      constructor() {
        if (!instance) {
          instance = this;
          // Pass the actual node path to the UISDKService constructor.
          let _path = (platform == 'darwin' ? './../sdk/mac/' : arch == 'x64' ? './../sdk/x64/' : './../sdk/win32/');
          let nodePath = path.join(window.__dirname, (_path + "HwmUisdk.node"));
          console.log("ApiService nodePath", nodePath);
          this.uisdkService = new UISDKService(nodePath);
        }
        return instance;
      }
      
      init(initInfo) {
        console.log("init, in param = ", initInfo);
        let ret = this.uisdkService.init(initInfo);
        console.log("init, out data = ", ret);
        return ret;
      }
    }
    

  7. Subscribe to event notifications.

    JavaScript APIs for subscribing to notifications that can be received by the third-party application are stored in js/api/. You can subscribe to these notifications by referring to AppService/NotifyService.js in the demo.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    import UISDKService from 'hwmsdk-electron';
    const os = window.require('os');
    const platform = os.platform();
    const arch = os.arch();
    const path = window.require("path");
     
    export default class NotifyService {
        static setNotifyFunc() {
            
            let _path = (platform == 'darwin' ? './../sdk/mac/' : arch == 'x64' ? './../sdk/x64/' : './../sdk/win32/');
            let nodePath = path.join(window.__dirname, (_path + "HwmUisdk.node"));
            console.log("NotifyService nodePath", nodePath);
            let uisdkService = new UISDKService(nodePath);
            uisdkService.getConfMgrApi().setOnConfListChangedCB(NotifyService.handleOnConfListChanged);
        }
    
        static handleOnConfListChanged(confListInfo) {
            console.log('OnConfListChanged', ', confListInfo = ', confListInfo);
            let _confListInfo = window.sessionStorage.getItem("confListInfo");
            _confListInfo = _confListInfo ? JSON.parse(_confListInfo) : [];
            console.log("sessionStorage confList:", _confListInfo);
            let conflistNew = confListInfo.confListItem;
            let _data = JSON.stringify(conflistNew ? conflistNew : []);
            window.sessionStorage.setItem("confListInfo", _data);
        }
    }
    

  8. (Optional) Use enumerations provided by the Electron SDK.

    You can use the enumeration definitions provided by the Electron SDK for the third-party application, copy packages/hwmsdk-electron/js/Api/enum.js and packages/hwmsdk-electron/types/Api/enum.d.ts to a directory of the project, and use these enumeration definitions by referring to packages/hwmsdk-electron-demo/src/Constants/typeOption.js in the demo.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    import { MediaType } from "./enum";
    
    export const MediaTypeOptions = [
        {
            value: MediaType.HWM_MEDIA_TYPE_AUDIO,
            label: "Audio",
        },
        {
            value: MediaType.HWM_MEDIA_TYPE_VIDEO,
            label: "Video",
        }
    ];
    

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback