Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
switch (Platform.OS) {
case 'ios':
// console.log('PUSHLOG: NotificationsIOS.consumeBackgroundQueue();');
NotificationsIOS.consumeBackgroundQueue();
break;
default:
break;
}
}
});
this.alarmActions = new NotificationCategory({
identifier: 'ALARM',
actions: [this.snoozeAction, this.stopAction],
context: 'default',
});
this.requestPermissions().then(() => {
this.checkStatus().catch(() => {
this.checkStatus();
});
});
// consume actions
NotificationsIOS.consumeBackgroundQueue();
// consume notifications
PushNotificationIOS.getInitialNotification(0).then((notification) => {
if (notification !== null) {
this.dispatch(snoozeAlarm(notification.getData().alarmUUID));
}
});
}
export function initializePushNotifications() {
// $FlowFixMe: error in type annotations of library
NotificationsIOS.requestPermissions();
NotificationsIOS.consumeBackgroundQueue();
}