input.GetTouch(0) and input.touches[0] not happening when built on iphone 7? [FIXED]

hello i am making an AR bubble popping game, but i was going to make the player pop the bubbles with rays and i made those rays shoot out when touching the screen and it worked in unity testing but it did not do anything when i actually built the game on to the phone

void Update()
{
    //this is supposed to get called when i touch the screen ⬇️⬇️⬇️ but it does absolutely nothing
    if (Input.touches.Length > 0 && Input.touches[0].phase == TouchPhase.Began) {
        //⬇️⬇️⬇️ this works fine it has no errors, but it's this ⬆️⬆️⬆️ that is giving me some problems
        DoThis();
    }
    
}

void DoThis() {
    Touch touch = Input.GetTouch(0);
    var ray = gameObject.GetComponent<Camera>().ScreenPointToRay(touch.position);
    RaycastHit hitInfo;
    if (Physics.Raycast(ray, out hitInfo)) {
        // this is supposed to be what makes the bubble pop
        hitInfo.collider.gameObject.GetComponent<SetBubble>().Pop();
        
    }
}

Edit : i actually fixed it apparently it was because i didn’t change the active input handling to both

First, Try to add debug.log in the doThis() method. Second I think your raycast may not be hitting any collider or hitted collider gameobject don’t have SetBubble Script attached to it. If you want console functionality on the ios device, use InGameConsole asset on playstore.