viromedia / viro

ViroReact: AR and VR using React Native
MIT License
2.31k stars 483 forks source link

How to disable back-arrow-icon at the top-left of the screen when setting vrModeEnabled = false (ViroSceneNavigator) #120

Open vjtc0n opened 6 years ago

vjtc0n commented 6 years ago

Hello Viro team,

I'm really excited about the latest release. But is there any ways to dynamically disable back-arrow-icon at the top-left of the screen when setting vrModeEnabled = false? such as: backArrowIconVisible={false} ? Because to handle this, it is super easy to do, and basically, in general, we don't like this icon in fullscreen.

And another issue is, in my application, we use vrModeEnabled (true and false) in 1 route, the value true/false is given in the params passed to this route from the previous one (you know what I mean, right?) The flow could be described like this: Route 1 --> navigate--> Route 2 (which has VR components). Firstly, Route 1 passed vrModeEnabled=false --> We watch VR mode like facebook did. Next, Route 2 --> goBack--> Route 1. Finally, Route 1 --> choose option vrModeEnabled=true, navigating and passing it to Route 2 And the app crashed.

So I have to degrade Viro back to 2.1.0 :(

achuvm commented 6 years ago

Hi @vjtc0n,

Unfortunately it’s not possible to remove that back button right now. We can see if we can turn that into an option in our next release.

As for the crash you’re running into. That does sound like a bug on our platform, we’ll see if we can reproduce it and fix it in our next release.

Thanks for reporting the issue!

Andy

sanderwapstra commented 5 years ago

@achuvm Any updates on this? On iPhone X it renders under the time and is not clickable. Thanks!

Hless commented 5 years ago

Still no updates? It looks very silly on iPhone X.

I'm going to look if I can cook up a workaround by disabling the view under the hood using a viewmanager of some sort...

Hless commented 5 years ago

Okay after some digging I found out that this is apparently baked into the underlying GoogleVR implementation. With no way to disable it unless VRMode is active. (See: https://developers.google.com/vr/ios/reference/interface_g_v_r_cardboard_view.html)

It is however possible to see the button being rendered as a view inside the XCode view inspector:

Screenshot 2019-10-16 at 15 59 00

A possible solution could be using wrapping the whole VR scene in a Native Module that forcibly removes the view, just like the solution below: https://github.com/googlevr/gvr-ios-sdk/issues/9#issuecomment-256703610

Will probably give it a go for our project and report back when I have created a solution.