Please note that Unity WebGL is not currently supported on mobiles. Press OK if you wish to continue anyway. OK

Unity is best tool for its support for multiple platforms. But in WebGL for android it creates some exception warning.

Problem:

When you run WebGL project on website. It works fine but when you open it on Mobile device it shows a warning Message.

 

“Please note that Unity WebGL is not currently supported on mobiles. Press OK if you wish to continue anyway. OK”

Solution:

This is a warning message embedded in your code by unity. If you want to remove this warning message from your app then you have to remove this exception check code from your unity loader file.

 

So Lets Test this Example.

 

When you build your project in WebGL, a complete folder is created having multiple files in it.

Basically two folders and an index file, Something like this.

Now you have to find unityLoader.JS file. It is inside Build folder.

Now open this “UnityLoader” file in any text editor. I am gonna open it in Notepad++.

Select all code and copy it.         //  [Select all(Ctrl + A) Copy (Ctrl+ C)]

Now open this link.

https://beautifier.io/

A new webpage will open, Something like that

Paste all your “UnityLoader”code into this section.

Now click on “Beautify code“ button. All of your code will be beautified.

Now copy all this code and paste it back to your UnityLoader.JS file.

Code is completely beautified. Now you have to remove “exception check” from the code.

Now search for the error code. To search error code press “Ctrl+F”. A new dialog box will open and type your error message in to it. “Please note that Unity WebGL”

Now finally you fond your error exception function.

Remove all the code from the function body of compatibility check. And type “t( );” in it.

Save your file and you are done with it.

 

Run your index file . You will not receive this exception again.

 

Hope this tutorial will help you a lot. If you feel any type of problem feel free to ask in comment section below.

Thanks.

4 comments

  1. Chris Alfonso

    i`ve done all the steps but i still get it on mobile please help me thanks!

    1. naisky

      After making a new build update code in it.

      If you still face issues. Contact me at nabeelahmed@naisky.com

  2. Charlie

    Thank you, naisky!

    I can’t believe there aren’t more comments, here! Great job!

    1. naisky

      Mine Pleasure ! Charlie

Leave a Reply

Your email address will not be published. Required fields are marked *

WhatsApp chat