You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libraries/README.md
+31-4Lines changed: 31 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,12 +30,39 @@ libraries/
30
30
31
31
We're including the MediaElement 7.0.0 source code to fix the Android 14+ notification body tap bug directly in the source, eliminating the need for the 800ms timer workaround.
32
32
33
+
### Fixes Applied
34
+
35
+
#### ✅ Android 14+ Notification Body Tap Fix (Commit: 804a177)
36
+
37
+
**Problem**: On Android 14+ (especially Pixel 7a), tapping the notification body did not bring the app to foreground.
38
+
39
+
**Solution**: Implemented the recommended Android 14+ approach using `MediaSession.SetSessionActivity()`:
40
+
41
+
1.**MediaManager.android.cs**:
42
+
- Added `SetSessionActivity()` call to set a PendingIntent that brings the app to foreground when notification body is tapped
43
+
- Uses explicit Intent targeting MainActivity with `CLEAR_TOP | SINGLE_TOP` flags for 100% reliability
44
+
- Stores the PendingIntent in a static property for fallback use
45
+
- Added proper error handling with logging
46
+
47
+
2.**MediaControlsService.android.cs**:
48
+
- Added fallback `SetContentIntent()` call using the stored PendingIntent from MediaManager
49
+
- This bypasses view interception and ensures notification body taps work for Android 14+
50
+
51
+
**Key Implementation Details**:
52
+
- Uses `Platform.CurrentActivity` (not `AppContext`) for creating the PendingIntent - this is critical for reliability
53
+
- Uses `PendingIntentFlags.Immutable | PendingIntentFlags.UpdateCurrent` for proper intent handling
54
+
- The fix follows Android's recommended approach for Android 14+ notification body taps
55
+
56
+
#### ✅ Removed Timer Workaround (Commit: d18747e)
57
+
58
+
Removed the 800ms timer workaround from `AndroidPlayerNotificationService.cs` that was continuously reapplying the notification ContentIntent. This hack is no longer needed with the proper fix in place.
59
+
33
60
### Next Steps
34
61
35
-
1. Add the project to the solution
36
-
2. Reference it instead of the NuGet package
37
-
3. Fix the notification bug in `Services/MediaControlsService.android.cs`or`Views/MediaManager.android.cs`
38
-
4. Remove the 800ms timer workaround from `AndroidPlayerNotificationService.cs`
62
+
1.✅ Add the project to the solution
63
+
2.✅ Reference it instead of the NuGet package
64
+
3.✅ Fix the notification bug in `Services/MediaControlsService.android.cs`and`Views/MediaManager.android.cs`
65
+
4.✅ Remove the 800ms timer workaround from `AndroidPlayerNotificationService.cs`
0 commit comments