GoogleVR iOS Overlay don't hide when VR is off

I noticed, that when you want to switch fron VR view to fullscreen view on iOS, than GoogleVR UI doesn’t dissapear, so the line, settings button and back arrow always on screen.

This is actually was postet here: GoogleVR layout visible if stereo is off on iOS - XR Development - Unreal Engine Forums

All methods, that are posted below the post don’t work.

To reproduce the issue:

  1. Create first person template blueprint project
  2. Enable GoogleVR plugin
  3. Restart editor
  4. Set the blueprint function “Enable HMD (false)” in level blueprint to any input you want. I did with Touch event.
  5. Package on iOS Development build
  6. Run the application
  7. Launch “Enable HMD (false)” by the way you have set
  8. See, that stereo rendering is off, black overlay dissapeared, but Google UI is still on the screen

Expected: VR mode switches to fullscreen, Google UI fully dissapears from screen
Result: VR mode switches to fullscreen, but Google UI is still on the screen. (white back arrow, settings button and vertical line at the center of the screen)

So I have been searching for some workarounds, and it seems, that any manipulations with setHidden methods don’t work. Here is an example from original post GoogleVR layout visible if stereo is off on iOS - XR Development - Unreal Engine Forums

NSArray* subviews = [[IOSAppDelegate GetDelegate].IOSView subviews];
 for (UIView* childView in subviews)
 {
     if ([childView isKindOfClass : [GVROverlayView class]] == YES)
     {
         // Get overlayView
         GVROverlayView* overlayView = (GVROverlayView*)childView;
         // stereo off/on
         [overlayView setHidden:YES/NO];
         break;
     }
 }

If somebody found the way to solve this problem, or found a working workaround for 4.16 engine version - I’ll very appreciate if you share this.

With this bug, Apple rejects the application and I can’t publish my application to AppStore. They also reject the app if it doesn’t have VR switch option which lets users to play without VR glasses. So this is important problem.

Hello mister_dan,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. When you say google VR, do you mean cardboard or daydream (please keep in mind there are no iphones listed on the official list of daydream ready devices)?
  2. Can you reproduce this issue in a clean project?
  3. If so, could you provide a detailed list of steps to reproduce this issue on our end (including any steps that may have been left out of your original steps)?
  4. If not, could you provide a zipped down project that reproduces this issue?
  5. What device(s) are you currently using when experiencing this issue?
  6. What OS is currently being run on the device(s)?

Passing this along:

You will have to change code in GoogleVR Plugin. So in .cpp, remove the following line in constructor:

 [[IOSAppDelegate GetDelegate].IOSView addSubview:OverlayView];
Then add the following line in ::EnableStereo function, below the #if GOOGLEVRHMD_SUPPORTED_ANDROID_PLATFORMS chunk:

 #if GOOGLEVRHMD_SUPPORTED_IOS_PLATFORMS
     dispatch_async(dispatch_get_main_queue(), ^
     {
         if (stereo)
         {
             [[IOSAppDelegate GetDelegate].IOSView addSubview : OverlayView];
         }
         else
         {
             [OverlayView removeFromSuperview];
         }
     }
 #endif

, this should be added on source and build? also what about GoogleVR with distribution Crash on iOS how is it possible to have in appstre if it cannnot launch on device?