How can I use the gyroscope to look around in a 360 scene?

I want to have a 360 environment, and be able to look around by moving my phone, not by swiping my finger. I’m surprised that I couldn’t find anything ;_;. Ideally this would be a script that I attach to the camera or any other entity that I want to look around.

see the similar topic here How do I use my phone's gyroscope to control the camera - #2 by poliveira