How to fit screen to visible window on mobile devices?

I’m using HEIGHT_CONTROLS_WIDTH on my game, which is primarily targeted to mobile devices, and I use camera height to determine the position of my game objects.

However, some browsers like Safari has bottom interface that caused my game to be cropped (see image below)

Capture
How can I actually scale the screen to fit the visible window size for ALL kinds of browsers?

Would viewport works for you?

The solution for this can be found here: