I would like to catch the notification events, but useLastNotificationResponse listener returns "Invalid hook call".
That's how i use it:
created() {
const lastNotificationResponse = Notifications.useLastNotificationResponse();
if (lastNotificationResponse && lastNotificationResponse.notification) {
this._handleNotification(lastNotificationResponse.notification);
}
Notifications.addNotificationReceivedListener(this._handleNotification);
Notifications.addNotificationResponseReceivedListener((response) => {
this._handleNotification(response.notification);
});
}
SDK version: 40
Thanks in advance!