-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathandroid.js
More file actions
30 lines (27 loc) · 791 Bytes
/
android.js
File metadata and controls
30 lines (27 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import {
NativeModules,
NativeAppEventEmitter,
} from 'react-native'
const { RNPush } = NativeModules
const RNPushAndroid = {
...RNPush,
addEventListener: function (event, listener) {
return NativeAppEventEmitter.addListener(event, listener)
},
removeEventListener: function (event, listener) {
return NativeAppEventEmitter.removeListener(event, listener)
},
getNotifications: () => { },
setBadgeNumber: () => { },
getBadgeNumber: () => 0,
clearBadge: () => { },
requestNotification: () => { },
checkPermission: async () => {
return RNPush.checkPermission()
},
checkNetwork:async()=>{
return RNPush.checkNetwork()
},
openSettingsForNotification: async () => { return RNPush.openSettingsForNotification() },
}
export default RNPushAndroid