How to get exact Absolute rotation to show the North

Hello, I have to solve an interesting task, I have GearVR, and I want to place a physical object in front of me, while I rotate my head around, I still want to know where is the physical object.
Is there any way to use a compass inside Samsung S8? SOmething that can give me a way to synchronize North on the phone and true North.

I only need a rotation, in absolute coordinates.