Open Whatsapp in Unity IOS Build

I can’t open whatsapp using de Application.OpenURL in IOS, this function is working in Editor and Android build, but don’t in IOS Build

I’m going through the same problem. It worked in the Windows editor and the Android build, but it didn’t work in the macOS editor or the iPhone build.


What solved it for me was creating an HTML page that runs a javascript code on onload and redirects to the WhatsApp API URL.
Host this page on my own server. And in Unity I use Application.OpenURL to open that page on my server.


<!DOCTYPE html>

<head lang="en-US">
    <meta charset="utf-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>My Game - Redirecting to WhatsApp...</title>
</head>

<body>
    <script type="text/javascript">
        window.onload = function () {
            let phone = "9999999999999";    // Including country and state code
            let message = "Hello, how are you doing?";

            let baseURL = "https://api.whatsapp.com/";
            let url = `${baseURL}send?phone=${phone}&text=${message.replace("%20", " ")}`;

            window.location = url;
        }
    </script>
</body>

</html>

I hope it helps!

You’ll need to utilize a combination of native code (Objective-C or Swift) and Unity’s C# scripting to add WhatsApp features to an iOS Unity build.
Make a native plugin that connects Unity to the capabilities of iOS devices. Swift or Objective-C both support this.

WhatsApp’s URL scheme may differ on iOS. Ensure you’re using the correct URL format for iOS, and check if the app’s URL scheme allows for opening via Application.OpenURL on iOS builds.