Bug 28980 - GKLocalPlayer.LocalPlayer.AuthenticateAsync throws exception if cancelled
Summary: GKLocalPlayer.LocalPlayer.AuthenticateAsync throws exception if cancelled
Status: NEW
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: master
Hardware: PC Mac OS
: --- enhancement
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-04-10 11:48 UTC by Rolf Bjarne Kvinge [MSFT]
Modified: 2015-04-10 11:48 UTC (History)
1 user (show)

Is this bug a regression?: ---
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 for Bug 28980 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Rolf Bjarne Kvinge [MSFT] 2015-04-10 11:48:24 UTC
[This is a split-off of first part of bug #28553]

Using await GKLocalPlayer.LocalPlayer.AuthenticateAsync (); causes an
NSErrorException if the GameCenter authentication dialog is cancelled. I would
(if at all) expect an OperationCanceledException or a proper return value. The
sync version of the method has a delegate that return an NSError, the async one
return a Task<void>

{Foundation.NSErrorException: Exception of type 'Foundation.NSErrorException'
was thrown.   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
() [0x0000b] in
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00034] in
   at GameKitDemo.GameKitDemoViewController+<ViewDidLoad>c__async0.MoveNext ()
[0x0003f] in
}    Foundation.NSErrorException) 

Test case: https://bugzilla.xamarin.com/show_bug.cgi?id=28553#c1