@fork-anyone/node-nim
Version:
NetEase IM nodejs wrapper based on NetEase IM C++ SDK
33 lines • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.V2NIMNotificationService = void 0;
const eventemitter3_1 = require("eventemitter3");
/** @brief 通知服务 */
class V2NIMNotificationService extends eventemitter3_1.EventEmitter {
constructor(sdk) {
super();
this.instance = new sdk.V2NIMNotificationService({ emit: this.emit.bind(this) });
}
/**
* @brief 发送自定义通知
* @param conversationId 会话 ID
* @param content 通知内容
* @param params 发送通知相关配置参数
* @returns void
* @example
* ```javascript
* await v2.notificationService.sendCustomNotification(conversationId, content, params)
* ```
*/
sendCustomNotification(conversationId, content, params) {
return new Promise((resolve, reject) => {
this.instance.sendCustomNotification(conversationId, content, params, () => {
resolve();
}, (error) => {
reject(error);
});
});
}
}
exports.V2NIMNotificationService = V2NIMNotificationService;
//# sourceMappingURL=v2_nim_notification_service.js.map