#javascript #react-native #expo #vue-native
Вопрос:
Я хотел бы перехватывать события уведомлений, но прослушиватель useLastNotificationResponse возвращает «Недопустимый вызов».
Вот как я его использую:
created() {
const lastNotificationResponse = Notifications.useLastNotificationResponse();
if (lastNotificationResponse amp;amp; lastNotificationResponse.notification) {
this._handleNotification(lastNotificationResponse.notification);
}
Notifications.addNotificationReceivedListener(this._handleNotification);
Notifications.addNotificationResponseReceivedListener((response) => {
this._handleNotification(response.notification);
});
}
Версия SDK: 40
Заранее спасибо!