a1phanumeric/iPhone-AR-Toolkit

Orientation disabled for the whole app , after presented ARViewcontroller

Closed this issue · 1 comments

Hi ,
Orientation disabled for the whole app , after presented ARViewcontroller. please help me to solve this issue.

if([ARKit deviceSupportsAR]){
_arViewController = [[ARViewController alloc] initWithDelegate:self];
[_arViewController setModalTransitionStyle: UIModalTransitionStyleFlipHorizontal];
[self presentViewController:_arViewController animated:YES completion:nil];
}

found some hint and trying to solve
http://stackoverflow.com/questions/4574693/ios-device-orientation-disregarding-orientation-lock

Hi,
I solved by adding [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
in AugmentedRealityController.m dealloc method

  • (void)dealloc {
    [self stopListening];
    [self unloadAV];
    locationManager.delegate = nil;
    [UIAccelerometer sharedAccelerometer].delegate = nil;
    [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; //newly added
    }