How to use the react-native-notifications.getInitialNotification function in react-native-notifications

To help you get started, we’ve selected a few react-native-notifications 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 RocketChat / Rocket.Chat.ReactNative / app / notifications / push / push.ios.js View on Github external
async configure(params) {
		this.onRegister = params.onRegister;
		this.onNotification = params.onNotification;

		const initial = await NotificationsIOS.getInitialNotification();
		// NotificationsIOS.consumeBackgroundQueue();
		return Promise.resolve(initial);
	}
}
github mattermost / mattermost-mobile / app / push_notifications / push_notifications.ios.js View on Github external
configure(options) {
        this.reduxStore = options.reduxStore;
        this.onRegister = options.onRegister;
        this.onNotification = options.onNotification;
        this.onReply = options.onReply;

        this.requestNotificationReplyPermissions();

        if (options.popInitialNotification) {
            NotificationsIOS.getInitialNotification().
                then((notification) => {
                    if (notification) {
                        const data = notification.getData();
                        if (data) {
                            ephemeralStore.appStartedFromPushNotification = true;
                            this.handleNotification(data, false, true);
                        }
                    }
                }).
                catch((err) => {
                    console.log('iOS getInitialNotifiation() failed', err); //eslint-disable-line no-console
                });
        }
    }

react-native-notifications

Advanced Push Notifications (Silent, interactive notifications) for iOS & Android

MIT
Latest version published 8 months ago

Package Health Score

70 / 100
Full package analysis