diff --git a/README.md b/README.md index 0451eed..e39d879 100644 --- a/README.md +++ b/README.md @@ -98,17 +98,17 @@ Tpns.clearAndAppendTags(new nanoId(),['tag1','tag2'],console.log,console.error); ```javascript // 接收消息事件 -window.addEventListener(Tpns.Constant.EVENT_ON_TEXT_MESSAGE,function(event){ +document.addEventListener(Tpns.Constant.EVENT_ON_TEXT_MESSAGE,function(event){ console.log("接收到消息:",event); }); // 已显示通知 -window.addEventListener(Tpns.Constant.EVENT_ON_NOTIFICATION_SHOWED_RESULT,function(event){ +document.addEventListener(Tpns.Constant.EVENT_ON_NOTIFICATION_SHOWED_RESULT,function(event){ console.log("已显示通知:",event); }); // 消息点击事件 -window.addEventListener(Tpns.Constant.EVENT_ON_NOTIFICATION_CLICKED_RESULT,function(event){ +document.addEventListener(Tpns.Constant.EVENT_ON_NOTIFICATION_CLICKED_RESULT,function(event){ console.log("消息点击事件:",event); }); ```