-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
25 lines (19 loc) · 718 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
import { DeviceEventEmitter } from 'react-native';
import Pushwoosh from 'pushwoosh-react-native-plugin';
Pushwoosh.init({
// Add your app code and Firebase sender ID here
"pw_appid" : "YOUR_APP_CODE",
"project_number" : "FIREBASE_SENDER_ID"
});
Pushwoosh.register();
DeviceEventEmitter.addListener('pushReceived', (e) => {
console.warn("pushReceived: " + JSON.stringify(e));
});
DeviceEventEmitter.addListener('pushOpened', (e) => {
console.warn("pushOpened: " + JSON.stringify(e));
// Handle the push notification opened event
});
AppRegistry.registerComponent(appName, () => App);