How to use the react-native-push-notification.getApplicationIconBadgeNumber 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 guardian / editions / projects / Mallard / src / helpers / push-notifications.ts View on Github external
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,
        permissions: {
            alert: false,
            badge: false,
            sound: false,
        },
    })

    // Designed to reset the badge number - can be removed over time
    PushNotification.getApplicationIconBadgeNumber(
        number =>
            number > 0 && PushNotification.setApplicationIconBadgeNumber(0),
    )
}
github DefinitelyTyped / DefinitelyTyped / types / react-native-push-notification / react-native-push-notification-tests.ts View on Github external
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();