Skip to content

Commit 274c737

Browse files
committed
Tapping action button now closes notification shade
1 parent 27020fc commit 274c737

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

OneSignalSDK/onesignal/src/main/java/com/onesignal/NotificationOpenedProcessor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ public class NotificationOpenedProcessor {
4646
private static Intent intent;
4747

4848
public static void processFromActivity(Context inContext, Intent inIntent) {
49-
if (inIntent.getBooleanExtra("action_button", false)) // Pressed an action button, need to clear the notification manually
49+
// Pressed an action button, need to clear the notification and close the notification area manually.
50+
if (inIntent.getBooleanExtra("action_button", false)) {
5051
NotificationManagerCompat.from(inContext).cancel(inIntent.getIntExtra("notificationId", 0));
52+
inContext.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
53+
}
5154

5255
processIntent(inContext, inIntent);
5356
}

0 commit comments

Comments
 (0)