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 (show other bugs)
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)

See Also:
Is this bug a regression?: ---
Last known good build:


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

Note You need to log in before you can comment on or make changes to this bug.