How to set up motion by moving phone without controllers or goggles?

Hi. I am stuck, after watching several videos and asked google using a variety different key words I give up. I simply need to ask you guys.

I want to create a virtual interior first person walk through where you move/rotate camera by moving your phone around, moving forward can be by either pinching phone screen or clicking on a target etc. I do not want to use goggles or motion controllers, solely by moving/pinching my phone.

Please help.