node-nim
Version:
NetEase IM nodejs wrapper based on NetEase IM C++ SDK
37 lines • 1.39 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.V2NIMNotificationService = void 0;
const loader_1 = __importDefault(require("../loader"));
const eventemitter3_1 = require("eventemitter3");
/** @brief 通知服务 */
class V2NIMNotificationService extends eventemitter3_1.EventEmitter {
constructor() {
super();
this.instance = new loader_1.default.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
;