Closed scastria closed 5 months ago
Just came across this issue, actually was looking for an alternative to GetCurrentAccountName as it is deprecated. Thank you!
It does not give the same result though, as i just get a unique ID, which might be fine for some cases :). To resolve the GET_ACCOUNTS demand, you should have a look at: https://github.com/xamarin/monodroid-samples/blob/master/android-m/RuntimePermissions/MainActivity.cs
I came to this sample after trying to follow Google's official documentation until I realized that Google's official documentation is newer than what Xamarin supports. The Xamarin.GooglePlayServices.Games and Auth nugets are OLD!! Some of the classes used in the official documentation are not in these OLD nuget packages. I tried the pre-release versions which helped some, but things like PlayersClient were still missing.
I decided to just copy in GameHelper.cs from this sample into my app and things worked great EXCEPT for:
This threw an exception stating that I needed GET_ACCOUNTS permission which this sample includes. I added it to my manifest and it still complained about this missing permission.
So I changed the above code to:
and that seemed to work WITHOUT needing GET_ACCOUNTS.