Baseflow / XamarinMediaManager

Cross platform Xamarin plugin to play and control Audio and Video
https://baseflow.com
MIT License
761 stars 304 forks source link

1.2.2 could crash on earlier Android devices when starting the foreground service. #894

Closed BajakiGabesz closed 1 year ago

BajakiGabesz commented 1 year ago

1.2.2 could crash on earlier Android devices when starting foreground service because the foregroundServiceType parameter is not known by some of the earlier operating systems such as Android Pie on Huawei P10.

https://github.com/Baseflow/XamarinMediaManager/blob/7f72e5b723e0fba418700bfa195a02db17f2433a/MediaManager/Platforms/Android/MediaSession/MediaBrowserService.cs#L144

I tested it on Xamarin.Forms and it causes crashes immediately on Android Pie and maybe on another operating system too. Should change when we are lower system version than Android 12: StartForeground(notificationId, notification);

martijn00 commented 1 year ago

Can you make a PR to add this check?

BajakiGabesz commented 1 year ago

Sure, will do it soon.

BajakiGabesz commented 1 year ago

The PR has been created.