-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy pathindex.js
47 lines (40 loc) · 1.21 KB
/
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**
* @format
*/
import {AppRegistry} from 'react-native';
import {
getMessaging,
setBackgroundMessageHandler,
} from '@react-native-firebase/messaging';
import App from './App';
import {name as appName} from './app.json';
setBackgroundMessageHandler(getMessaging(), async (message) => {
setImmediate(() => {
console.log(
'This is running from setBackgroundMessageHandler::setImmediate',
);
});
console.log(
'setBackgroundMessageHandler JS executing. Received message: ' +
JSON.stringify(message),
);
// // Display a notification
// await notifee.displayNotification({
// title: 'Notification Title',
// body: 'Main body content of the notification',
// android: {
// channelId: 'misc',
// // pressAction is needed if you want the notification to open the app when pressed
// pressAction: {
// id: 'default',
// },
// },
// });
});
// notifee.onBackgroundEvent(async event => {
// setImmediate(() => {
// console.log('This is running from notifee.onBacgroundEvent::setImmediate');
// });
// console.log('notifee.onBackgroundEvent with event: ' + JSON.stringify(event));
// });
AppRegistry.registerComponent(appName, () => App);