Bug 55817 - MediaPlayer.MPNowPlayingInfo is not implemented on Mac
Summary: MediaPlayer.MPNowPlayingInfo is not implemented on Mac
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Library (Xamarin.Mac.dll) ()
Version: unspecified
Hardware: PC Windows
: Normal enhancement
Target Milestone: Xcode9
Assignee: Sebastien Pouliot
Depends on:
Reported: 2017-04-29 21:27 UTC by Ivan Icin
Modified: 2017-08-03 13:13 UTC (History)
4 users (show)

Is this bug a regression?: No
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Ivan Icin 2017-04-29 21:27:29 UTC
I have a code that is working on iOS, and as the same API is used on Mac it should work without the problem, but MediaPlayer.MPNowPlayingInfo is not implemented on Xamarin.Mac at all.

Probably as a result of that, there is also no MediaPlayer.MPNowPlayingInfoCenter.DefaultCenter.NowPlaying at all (which should return MediaPlayer.MPNowPlayingInfo) so for now I won't file the separate bug.
Comment 1 Alex Soto [MSFT] 2017-04-30 21:09:50 UTC
Confirmed it seems we need to audit this API to expose the strong dict in macOS too

Comment 2 Sebastien Pouliot 2017-08-01 03:33:45 UTC
Support for `MPNowPlayingInfoCenter` (which is what I think you're referring) was added. The type is decorated with `[Mac (10,12,2, onlyOn64: true)]`

However there is not such thing as `MediaPlayer.MPNowPlayingInfoCenter.DefaultCenter.NowPlaying` and no `MediaPlayer.MPNowPlayingInfo`, typos ?

Please try again with the latest XM (3.4 or 3.6 in beta) and let us know if something else is missing (it should be complete as I just reviewed this for Xcode9 API).

I'll take care of updating the strong dictionary like Alex mentioned in comment #1 (as part of the Xcode9 update)
Comment 3 Ivan Icin 2017-08-01 07:07:32 UTC
I was referring to what I was referring. Check your implementation for iOS, those things do exist. I can't find the links in the online documentation, but if you write this code it will work (and actually it can't work any other way):

var info = new MediaPlayer.MPNowPlayingInfo();
MediaPlayer.MPNowPlayingInfoCenter.DefaultCenter.NowPlaying = info;

As it is exactly the same API as on iOS you should try to make it uniform.
Comment 4 Sebastien Pouliot 2017-08-01 12:32:04 UTC
Sorry, I see it now. It's a manual helper (not generated bindings).

This will be enabled in a future release of XM (it's part of comment #1) -starting with XM 3.99 previews as this needs to be updated with new Xcode9 API.
Comment 5 Sebastien Pouliot 2017-08-01 15:01:47 UTC
Comment 6 Sebastien Pouliot 2017-08-03 13:13:06 UTC
PR merged in https://github.com/xamarin/xamarin-macios/commit/8c7b776d86246c261e916c73fa6aca0cbdba91dd

The code will be in XM 3.99 preview 4 (next week)