Skip to content

Commit

Permalink
Merge pull request #931 from LcTerry/master
Browse files Browse the repository at this point in the history
更新版本号3.0.4 + 暴露CommandEvent 回调
  • Loading branch information
LcTerry authored Sep 13, 2023
2 parents f22de5e + cfcdd51 commit 66fd0ce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"dependencies": {
"jcore-react-native": "2.1.3",
"jpush-react-native": "3.0.3",
"jpush-react-native": "3.0.4",
"react": "16.8.6",
"react-native": "0.60.5",
"update": "^0.7.4"
Expand Down
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const CustomMessageEvent = 'CustomMessageEvent' //自定义消息事件
const InappMessageEvent = 'InappMessageEvent' //应用内消息事件
const TagAliasEvent = 'TagAliasEvent' //TagAlias/Pros事件
const MobileNumberEvent = 'MobileNumberEvent' //电话号码事件
const CommandEvent = 'CommandEvent' //COMMAND事件

export default class JPush {

Expand Down Expand Up @@ -433,6 +434,13 @@ export default class JPush {
callback(result)
})
}
//CommandEvent 事件回调
static addCommandEventListener(callback) {
listeners[callback] = DeviceEventEmitter.addListener(
CommandEvent, result => {
callback(result)
})
}

/*
* 通知事件
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "index.d.ts",
"license": "ISC",
"author": "wicked.tc130",
"version": "3.0.3",
"version": "3.0.4",
"repository": {
"type": "git",
"url": "https://github.com/jpush/jpush-react-native"
Expand Down

0 comments on commit 66fd0ce

Please sign in to comment.