eventSystem.IsPointerOverGameObject for mobile devices

I have the following code to prevent a raycast from being cast into the 3d world when my mouse is on a uGUI element.

  if (!GUIController.Instance.eventSystem.IsPointerOverGameObject())
  {
     //raycast here on mouse click
  }

Works perfectly for editor, but when I build for iOS, it doesn’t work. Does anyone has a solution for this?
Thanks

private int fingerID = -1;
private void Awake(){
#if !UNITY_EDITOR
fingerID = 0;
#endif
}

// Elsewhere

if (!GUIController.Instance.eventSystem.IsPointerOverGameObject(fingerID))
{
  //raycast here on mouse click
}

The method gets a default value of -1 when none is passed, and that default value is not the same as the one needed for mobile, 0.

With this code, you have nothing to do when you pass from editor to mobile thanks to the macro (if you need standalones then you need to add them).
At least I had the same issue with another similar method (IsPointerOverGameObject) and that fixed it.