Accelerometor/Gyroscope position tracking?

Hello.

I have a technical problem I need to solve. It is basically creating a system motion gesture tracking and recognition using an iOS device. The expected use is very much like a wiimote. I don’t really have an idea on how the wiimote actually tracks and recognizes the motion but from what I observed on Unity’s accelerometer and gyroscope API is that they only track the device’s orientation.

My problem is, I want to know the positioning of the device also to track the panning. So for example, without changing the orientation of the device, it is moved around. I want to know the direction it is moved around. Is this possible with the provided API?

From my experiments, Input.acceleration and Input.gyroscope.gravity produce the same values and does not mean the direction (panning) applied on the device. How do I go about this? Or is the wii just similar? Is it all about orientation tracking and we are just led to believe that we are tracking position but it is really not?

Thank you.

If you want the direction the device is facing try using the compass.
Code snippet below:
Click this link for more info.

  Input.compass.enabled = true;
transform.rotation = Quaternion.Euler(0, -Input.compass.magneticHeading, 0);