Okay, I’ve got some!
I tryed many different methods to hide GVROverlay, but nothing worked.
So, I managed just do not even create it (ha-ha)
You can comment this line and no overlay will appear. It also affects startup screen, which telling the user to put the phone into cardboard. By the way this is exactly what I was looking for too.
So take a look at FGoogleVRHMD::FGoogleVRHMD() method, find and comment the line “[[IOSAppDelegate GetDelegate].IOSView addSubview:OverlayView];”, which obviously just adds the overlay to screen. So if there are some calls to it, the app will not crash and etc.
See few lines of code here:
// We will use Unreal's PostProcessing Distortion for iOS
bUseGVRApiDistortionCorrection = false;
bIsInDaydreamMode = false;
// Setup and show ui on iOS
OverlayViewDelegate = [[FOverlayViewDelegate alloc] init];
OverlayView = [[GVROverlayView alloc] initWithFrame:[IOSAppDelegate GetDelegate].IOSView.bounds];
OverlayView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
OverlayView.delegate = OverlayViewDelegate;
// [[IOSAppDelegate GetDelegate].IOSView addSubview:OverlayView];
I use UE 4.16.2
It is a bad way to solve this problem, because application crashes, if you comment this line. It crashes only when you upload the app to TestFlight, downloar and run. When you directly install the application, it works fine.
Update2: atually I found the problem with crashing and it is not connected to disabling GVROverlay by commenting the line. So this method is actually okay to use. To make it work you need a source-built UE4. After you package a game for iOS once, you can replace *a file in GoogleVR/Binaries/IOS from source build to binary engine in the same place. That is what I have done for my project.
And one more thing! Doing this:
[overlayView setHidden:YES/NO]; disables Google UI, so settings button and back arrow don’t respond, if you call [overlayView setHidden:YES]; they begin respond again when you turn it on, but image is still on screen in both situations. I think, that this image is not GVROverlayView class, or there are two items, one - as image, one - as triggers on this image. But I couldn’t find anything deeper in that case.