Detect platform using WebGL build

I’m running unity webgl build on desktop browsers with desktop input settings. Now I need to make the build playable for ipad touch screens as well, and for that I need to detect whether the user is running the webgl app in a touch device browser or on a desktop/laptop browser. I have already used and tested the following code in ipad and desktop but it did not detect the platform properly.

 public Text text;

    private void Start()
        if (SystemInfo.deviceType == DeviceType.Handheld)
            text.text = "You are on a handheld device";
            text.text = "You are on a non touch device";

It was showing “You are on a non touch device” in the touch device as well as in the desktop browser.
I have also tried this solution but it seems that I cannot make it work. I did not have the plugins folder inside of my assets folder so I had to make the folders manually. The version Im running is 2020.3.24f1.
Any help would be helpful, thank you.

I am not really sure that this is what you are looking for but the following link may help you :

I am also encountering this issue. Dont know why its hapenning.
NGS Medicare Connex