-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnotificationCallbacks.js
More file actions
22 lines (21 loc) · 945 Bytes
/
notificationCallbacks.js
File metadata and controls
22 lines (21 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import Pushe from 'pushe-react-native';
module.exports = async notificationData => {
if (notificationData.EVENT_TYPE === Pushe.EVENTS.RECEIVED) {
// Notification received
console.log('BG notification received', notificationData);
} else if (notificationData.EVENT_TYPE === Pushe.EVENTS.CLICKED) {
// Notification clicked
console.log('BG notification clicked', notificationData);
} else if (notificationData.EVENT_TYPE === Pushe.EVENTS.DISMISSED) {
// Notification dismissed
console.log('BG notification dismissed', notificationData);
} else if (notificationData.EVENT_TYPE === Pushe.EVENTS.BUTTON_CLICKED) {
// Notification Button clicked
console.log('BG notification button clicked', notificationData);
} else if (
notificationData.EVENT_TYPE === Pushe.EVENTS.CUSTOM_CONTENT_RECEIVED
) {
// Custom Content Received
console.log('BG notification custom content', notificationData);
}
};