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.

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
                });
        }
    }