React-native-push-notification: userInteraction always false

Created on 1 Oct 2019  路  9Comments  路  Source: zo0r/react-native-push-notification

Hello Friends ,,

I have a problem with click on notification from notification center ( in android ) ,
when I receive notification the userInteraction is false and when i click the notification also it's keep false without any change ..

any solution ?

Stale

Most helpful comment

Same here on iOS, when I have the app in foreground, I open the notificacion center and tap a notification, onNotification is called but the userInteraction flag is false.
Any solution?

react-native-puth-notification: 3.1.9
ios: 13.2.3

Android works great.

All 9 comments

Hi, Are you using Local notification?

actually I am using remote notification .

One thing also , I think is related with it , onNotification() is not fire when tapping also
userInteraction I put insideonNotification() and whole code inside constructor

Also same issue here.
Push notification is configured in componentDidMount however userInteraction is just missing on notification that is opened from notification center

Same here.
Using: 3.1.3 - the version before AndroidX as we haven't migrated yet.
Also should migration to AndroidX be a major version bump? 馃

Same here on iOS, when I have the app in foreground, I open the notificacion center and tap a notification, onNotification is called but the userInteraction flag is false.
Any solution?

react-native-puth-notification: 3.1.9
ios: 13.2.3

Android works great.

the same

This workaround worked for me. (android)

import nextFrame from "next-frame";
// ..
async onNotification (notification) {
     await nextFrame(); // this is required to get appState == active
    notification.userInteraction = notification.userInteraction || (!notification.foreground && AppState.currentState == "active");
}

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

atteia picture atteia  路  4Comments

GastonEDiaz picture GastonEDiaz  路  3Comments

nguyenvanphuc2203 picture nguyenvanphuc2203  路  3Comments

cookienawer picture cookienawer  路  3Comments

cidevant picture cidevant  路  3Comments