How to use the react-native-push-notification.cancelAllLocalNotifications 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 mongrov / roverz / src / network / VCUtil.js View on Github external
incomingVC(groupID, rUID, rUName) {
    console.log('Kumar push VCUTIL invc ', groupID, rUID, rUName);
    this._gid = groupID;
    this._remoteuid = rUID;
    this._remoteName = rUName;
    PushNotification.cancelAllLocalNotifications();
    PushNotification.localNotificationSchedule({
      message: `Video Calling ${this._remoteName}`, // (required)
      playSound: false,
      autoCancel: false,
      vcData: {
        groupID,
        rUID,
      },
      date: new Date(Date.now()), // in 60 secs
      // actions: '["Accept", "Reject"]',
    });
    // InCallManager.startRingtone('_BUNDLE_');
    // InCallManager.turnScreenOn();

    // if (!this._net) {
    //   this._net = new Network();
github mongrov / roverz / src / network / VCUtil.js View on Github external
incomingVCDisconnect() {
    PushNotification.cancelAllLocalNotifications();
    // InCallManager.stopRingtone();
  }
github keybase / client / shared / actions / platform-specific / push.native.tsx View on Github external
function* handlePush(state: Container.TypedState, action: PushGen.NotificationPayload) {
  try {
    const notification = action.payload.notification
    logger.info('[Push]: ' + notification.type || 'unknown')

    switch (notification.type) {
      case 'chat.readmessage':
        logger.info('[Push] read message')
        if (notification.badges === 0) {
          PushNotifications.cancelAllLocalNotifications()
        }
        break
      case 'chat.newmessageSilent_2':
        // entirely handled by go on ios and in onNotification on Android
        break
      case 'chat.newmessage':
        yield* handleLoudMessage(notification)
        break
      case 'follow':
        // We only care if the user clicked while in session
        if (notification.userInteraction) {
          const {username} = notification
          logger.info('[Push] follower: ', username)
          yield Saga.put(ProfileGen.createShowUserProfile({username}))
        }
        break
github keybase / client / shared / actions / platform-specific / push.native.js View on Github external
function* handlePush(_, action) {
  try {
    const notification = action.payload.notification
    logger.info('[Push]: ' + notification.type || 'unknown')

    switch (notification.type) {
      case 'chat.readmessage':
        logger.info('[Push] read message')
        if (notification.badges === 0) {
          PushNotifications.cancelAllLocalNotifications()
        }
        break
      case 'chat.newmessageSilent_2':
        // entirely handled by go on ios and in onNotification on Android
        break
      case 'chat.newmessage':
        yield* handleLoudMessage(notification)
        break
      case 'follow':
        // We only care if the user clicked while in session
        if (notification.userInteraction) {
          const {username} = notification
          logger.info('[Push] follower: ', username)
          yield Saga.put(ProfileGen.createShowUserProfile({username}))
        }
        break
github DefinitelyTyped / DefinitelyTyped / types / react-native-push-notification / react-native-push-notification-tests.ts View on Github external
notification.finish("UIBackgroundFetchResultNoData");
    },
    onRegister: (token) => {},
    senderID: 'XXX',
    popInitialNotification: false,
    requestPermissions: true,
});

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 Illu / moonwalk / src / Models / LaunchesModel.js View on Github external
android: data => {
      if (this.notifications.enabled) {
        PushNotification.cancelAllLocalNotifications();
        PushNotification.localNotificationSchedule({
          date: new Date(data.isostart),
          message: `🚀 ${data.name} will launch in just ${
            this.notifications.delay
          } minutes!`
        });
      }
    }
  });
github keybase / client / shared / native / notification-listeners.native.js View on Github external
sharedNotificationActions(count => {
    RNPN.setApplicationIconBadgeNumber(count)
    if (count === 0) {
      RNPN.cancelAllLocalNotifications()
    }
  })
}
github zo0r / react-native-push-notification / example / NotifService.js View on Github external
cancelAll() {
    PushNotification.cancelAllLocalNotifications();
  }
}
github open-app / app-hub-mobile / src / utils / pushNotificationConfig.js View on Github external
const cancelAllNotifications = () => PushNotification.cancelAllLocalNotifications()
github keybase / client / shared / actions / platform-specific.native.js View on Github external
function clearAllNotifications() {
  PushNotifications.cancelAllLocalNotifications()
}