Image-Text Live Streaming
Feature Overview
This module is primarily used to receive backend operations for adding, editing, deleting, and pinning image-text messages.
Initialization and Destruction
Before instantiating and using this module, the SDK must be initialized and configured. For details, see the reference documentation.
Online File Import Method
// script 标签引入,根据版本号引入JS版本。
<script src="https://websdk.videocc.net/interactions-receive-sdk/0.24.0/lib/polyv-ir.umd.js"></script>
<script>
const { Tuwen } = window.PolyvIRSDK;
</script>
Import Method (Recommended)
import { Tuwen } from '@polyv/interactions-receive-sdk';
const tuwenSdk = new Tuwen();
Usage Flow
Listen for Adding a New Image-Text Message
tuwenSdk.on(tuwenSdk.events.CREATE, (msg) => { console.log('Insert new message', msg.data); })
Listen for Updating an Image-Text Message
tuwenSdk.on(tuwenSdk.events.UPDATE, (msg) => { console.log('Update message', msg.data); })
Listen for Editing and Pinning an Image-Text Message
tuwenSdk.on(tuwenSdk.events.EDIT_STICKY, (msg) => { console.log('Edit pinned message', msg.data); })
Listen for Deleting an Image-Text Message
tuwenSdk.on(tuwenSdk.events.DELETE, (msg) => { console.log('Delete message', msg.data); })
Listen for Setting User Information
tuwenSdk.on(tuwenSdk.events.SET_USER_INFO, (msg) => { console.log('Set user info', msg.data); })
Retrieve Image-Text Message List
// Data start ID. If startId is empty, it indicates initializing data. By default, the first ten data entries are requested. tuwenSdk.getTuwenInfo(startId);
