Right now right after user approved the permissions for a camera and GPS I have black screen with pois. It semms like there is an issue realted to the camera, because pois are moving on device position change so that part works nice, in addtion if I kill the app and then start it everyting is fine (User already approved the permissions) Any thoughts what could be the issue ? Code bellow :
- (void)viewDidLoad {
[super viewDidLoad];
NSError *deviceNotSupportedError = nil;
if ( [WTArchitectView isDeviceSupportedForRequiredFeatures:WTFeature_Geo error:&deviceNotSupportedError] ) { // 1
self.architectView.delegate = self;
[self.architectView setLicenseKey:@""];
self.architectWorldNavigation = [self.architectView loadArchitectWorldFromURL:[[NSBundle mainBundle] URLForResource:@"index" withExtension:@"html" subdirectory:@"4_PointOfInterest_4_SelectingPois"] withRequiredFeatures:WTFeature_Geo | WTFeature_2DTracking];
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidBecomeActiveNotification
object:nil
queue:[NSOperationQueue mainQueue]
usingBlock:^(NSNotification *note) {
if (self.architectWorldNavigation.wasInterrupted) {
[self.architectView reloadArchitectWorld];
}
[self startRunning];
}];
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationWillResignActiveNotification
object:nil
queue:[NSOperationQueue mainQueue]
usingBlock:^(NSNotification *note) {
[self startRunning];
}];
} else {
NSLog(@"device is not supported - reason: %@", [deviceNotSupportedError localizedDescription]);
}
}
-(void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self startRunning];
}
- (void)startRunning {
if ( ![self.architectView isRunning] ) {
[self.architectView start:^(WTStartupConfiguration *configuration) {
configuration.captureDevicePosition= AVCaptureDevicePositionBack;
} completion:^(BOOL isRunning, NSError *error) {
if ( !isRunning ) {
NSLog(@"WTArchitectView could not be started. Reason: %@", [error localizedDescription]);
}
}];
}
}
I fixed this issue by check on
UIApplicationDidBecomeActiveNotification
notification if the Wikitude engine is on. If not I execute Wikitude's start method and everything works fine.