GameCenter authentication in landscape-only app throws UIApplicationInvalidInterfaceOrientation

While writing this question and experimenting with code, it seems that I’ve found a solution:
enable all orientations in project summary and remove application:supportedInterfaceOrientationsForWindow.

Add this code to ViewController:

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskLandscape;
}

Now it works seamlessly.

Leave a Comment