How to use the @react-native-community/push-notification-ios.FetchResult function in @react-native-community/push-notification-ios

To help you get started, we’ve selected a few @react-native-community/push-notification-ios 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 guardian / editions / projects / Mallard / src / helpers / push-notifications.ts View on Github external
JSON.stringify(pushImageSummary),
                    )

                    await downloadAndUnzipIssue(pushImageSummary, screenSize)

                    await pushTracking('pushDownloadComplete', 'completed')

                    notificationTracking(notificationId, 'downloaded')
                } catch (e) {
                    await pushTracking('pushDownloadError', JSON.stringify(e))
                    errorService.captureException(e)
                } finally {
                    // No matter what happens, always clear up old issues
                    await clearOldIssues()
                    // required on iOS only (see fetchCompletionHandler docs: https://facebook.github.io/react-native/docs/pushnotificationios.html)
                    notification.finish(PushNotificationIOS.FetchResult.NoData)
                }
            }
        },
        senderID: defaultSettings.senderId,
github OriginProtocol / origin / mobile / src / PushNotifications.js View on Github external
onNotification: notification => {
        this.onNotification(notification)
        // https://facebook.github.io/react-native/docs/pushnotificationios.html
        if (Platform.OS === 'ios') {
          notification.finish(PushNotificationIOS.FetchResult.NoData)
        }
      },
      // Android only
github rastapasta / foodsharing / src / sagas / notifications.tsx View on Github external
onNotification: notification => {
      store.dispatch({type: NOTIFICATION_CLICKED})

      // If we were able to set some data along with the notification (iOS), handle it!
      const { data } = notification
      if (data && data.conversationId)
        Actions.conversation({conversationId: data.conversationId})
      else if (data && data.bellId)
        Actions.bells()
      else
        Actions.conversations()

      // If we're on iOS, trigger the expected callback
      if (Platform.OS === 'ios')
        notification.finish(PushNotificationIOS.FetchResult.NoData)
    }
  })
github burst-apps-team / phoenix / mobile / App.tsx View on Github external
const onNotification = (notification: PushNotificationIOS) => {
      if (!notification.foreground) {
        // @ts-ignore
        this.navigator.dispatch(
          NavigationActions.navigate({
            routeName: routes.accountDetails,
            params: {
              accountRS: notification.data.accountRS
            }
          })
        );
      }
      // required on iOS only (see fetchCompletionHandler docs:
      // https://github.com/react-native-community/react-native-push-notification-ios)
      notification.finish(PushNotificationIOS.FetchResult.NoData);
    };