Skip to content

Commit cfcdd51

Browse files
committed
更新版本号3.0.4 + 暴露CommandEvent 回调
1 parent f22de5e commit cfcdd51

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"dependencies": {
1010
"jcore-react-native": "2.1.3",
11-
"jpush-react-native": "3.0.3",
11+
"jpush-react-native": "3.0.4",
1212
"react": "16.8.6",
1313
"react-native": "0.60.5",
1414
"update": "^0.7.4"

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const CustomMessageEvent = 'CustomMessageEvent' //自定义消息事件
1414
const InappMessageEvent = 'InappMessageEvent' //应用内消息事件
1515
const TagAliasEvent = 'TagAliasEvent' //TagAlias/Pros事件
1616
const MobileNumberEvent = 'MobileNumberEvent' //电话号码事件
17+
const CommandEvent = 'CommandEvent' //COMMAND事件
1718

1819
export default class JPush {
1920

@@ -433,6 +434,13 @@ export default class JPush {
433434
callback(result)
434435
})
435436
}
437+
//CommandEvent 事件回调
438+
static addCommandEventListener(callback) {
439+
listeners[callback] = DeviceEventEmitter.addListener(
440+
CommandEvent, result => {
441+
callback(result)
442+
})
443+
}
436444

437445
/*
438446
* 通知事件

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"types": "index.d.ts",
77
"license": "ISC",
88
"author": "wicked.tc130",
9-
"version": "3.0.3",
9+
"version": "3.0.4",
1010
"repository": {
1111
"type": "git",
1212
"url": "https://github.com/jpush/jpush-react-native"

0 commit comments

Comments
 (0)