Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit c283ac4

Browse files
committed
Fix a bug where user interaction is not set.
1 parent eb538f2 commit c283ac4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotification.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ private Bundle getBundleFromIntent(Intent intent) {
8282
} else if (intent.hasExtra("google.message_id")) {
8383
bundle = intent.getExtras();
8484
}
85+
86+
if(null != bundle && !bundle.getBoolean("foreground", false) && !bundle.containsKey("user_interaction")) {
87+
bundle.putBoolean("user_interaction", true);
88+
}
89+
8590
return bundle;
8691
}
8792

android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationPublisher.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ private void handleLocalNotification(Context context, Bundle bundle) {
3939

4040
Application applicationContext = (Application) context.getApplicationContext();
4141
RNPushNotificationHelper pushNotificationHelper = new RNPushNotificationHelper(applicationContext);
42-
43-
boolean isForeground = pushNotificationHelper.isApplicationInForeground();
4442

4543
Log.v(LOG_TAG, "sendNotification: " + bundle);
4644

0 commit comments

Comments
 (0)