Device Orientation Incorrect When Notification Banner Appears

60 views Asked by At

I have an app that is monitoring the "orientation" property of UIDevice. All is well except for whenever a push notification or SMS (anything that triggers a banner notification to appear above the app) shows up, the UIDevice class reports UIDeviceOrientationPortrait.

This feels like a bug, but I'm not sure if anyone else has seen this or knows it is expected.

1

There are 1 answers

0
M David On

By adding below method to your AppDelegate.m class your app must be able to support all types of device orientation.

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return UIInterfaceOrientationMaskAll; 
}

Also you can check all device orientation as shown in image Device orientation in iOS app

Good Luck