diff --git a/Bugsnag/Client/BugsnagClient.m b/Bugsnag/Client/BugsnagClient.m index 1d4993e53..7895eab89 100644 --- a/Bugsnag/Client/BugsnagClient.m +++ b/Bugsnag/Client/BugsnagClient.m @@ -282,6 +282,10 @@ - (instancetype)initWithConfiguration:(BugsnagConfiguration *)configuration { NSDictionary *systemInfo = [BSG_KSSystemInfo systemInfo]; [self.metadata addMetadata:BSGParseAppMetadata(@{@"system": systemInfo}) toSection:BSGKeyApp]; [self.metadata addMetadata:BSGParseDeviceMetadata(@{@"system": systemInfo}) toSection:BSGKeyDevice]; +#if BSG_PLATFORM_IOS + _lastOrientation = BSGOrientationNameFromEnum([UIDEVICE currentDevice].orientation); + [self.state addMetadata:_lastOrientation withKey:BSGKeyOrientation toSection:BSGKeyDeviceState]; +#endif // sync initial state [self metadataChanged:self.metadata]; [self metadataChanged:self.state]; @@ -300,10 +304,6 @@ - (instancetype)initWithConfiguration:(BugsnagConfiguration *)configuration { self.pluginClient = [[BugsnagPluginClient alloc] initWithPlugins:self.configuration.plugins client:self]; -#if BSG_PLATFORM_IOS - _lastOrientation = BSGOrientationNameFromEnum([UIDEVICE currentDevice].orientation); -#endif - if (self.user.id == nil) { // populate with an autogenerated ID if no value set [self setUser:[BSG_KSSystemInfo deviceAndAppHash] withEmail:configuration.user.email andName:configuration.user.name]; } @@ -380,7 +380,6 @@ - (void)start { [[UIDEVICE currentDevice] beginGeneratingDeviceOrientationNotifications]; [self batteryChanged:nil]; - [self orientationChanged:nil]; [self addTerminationObserver:UIApplicationWillTerminateNotification]; #elif BSG_PLATFORM_OSX