How to use the react-native-push-notification.registerNotificationActions function in react-native-push-notification

To help you get started, we’ve selected a few react-native-push-notification examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github open-app / app-hub-mobile / src / utils / pushNotificationConfig.js View on Github external
(function() {
  // Register all the valid actions for notifications here and add the action handler for each action
  PushNotification.registerNotificationActions([ i18n.t('notificationAction') ])
  DeviceEventEmitter.addListener('notificationActionReceived', (action) => {
    console.log ('Notification action received: ' + action)
    const info = JSON.parse(action.dataJSON)
    if (info.action == i18n.t('notificationAction')) {
      if (Platform.OS === 'android') BackHandler.exitApp()
      else RNExitApp.exitApp()
    }
  })
})()
github DefinitelyTyped / DefinitelyTyped / types / react-native-push-notification / react-native-push-notification-tests.ts View on Github external
});

PushNotification.unregister();
PushNotification.localNotification = (details) => {};
PushNotification.localNotificationSchedule = (details) => {};
PushNotification.requestPermissions();
PushNotification.presentLocalNotification = (details) => {};
PushNotification.scheduleLocalNotification = (details) => {};
PushNotification.cancelLocalNotifications = (details) => {};
PushNotification.cancelAllLocalNotifications();
PushNotification.setApplicationIconBadgeNumber(1);
PushNotification.getApplicationIconBadgeNumber((badgeCount) => {});
PushNotification.popInitialNotification((notification) => {});
PushNotification.checkPermissions((checkPermissions) => {});
PushNotification.abandonPermissions();
PushNotification.registerNotificationActions(['Accept', 'Reject', 'Yes', 'No']);
PushNotification.clearAllNotifications();
github CMP-Studio / DawnChorus / app / actors / notifications.android.js View on Github external
if (notification.action === 'Stop') {
            store.dispatch(stopAlarm(notification.alarmUUID));
          } else if (notification.action === 'Snooze') {
            store.dispatch(snoozeAlarm(notification.alarmUUID));
          }
        } else {
          store.dispatch(soundAlarm(notification.alarmUUID));
        }
      },

      popInitialNotification: true,

      requestPermissions: true,
    });

    PushNotification.registerNotificationActions(['Snooze', 'Stop']);
    this.checkStatus();
  }