Websockets not working only on iOS

Hello,

I develop an iOS game with Unreal Engine 5. My game works perfectly well in the Editor on my mac and on Android, but on iOS somehow once the app in installed, it cannot connect to our game server through WebSocket with a wss URL.

wss being a secured connection I don't see what the issue is, but it looks like it's being blocked by Apple ? No issue communicating with Rest API with our server thought. I have done that so far :

In App ID profile I enabled Custom Networks and Push Notification, set up a SSL certificate. Here is my change in the .plist:

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>MyApp</string>
        </array>
    </dict>
</array>
<key>NSCameraUsageDescription</key>
<string>We don't and cannot use the Camera at all but UnrealEngine integrates SDK for games using camera</string>
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSAllowsArbitraryLoadsForMedia</key>
    <true/>
    <key>NSAllowsArbitraryLoadsInWebContent</key>
    <true/>
    <key>NSAllowsLocalNetworking</key>
    <true/>
    <key>NSExceptionDomains</key>
    <dict>
        <key>myapp.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionMinimumTLSVersion</key>
            <string>TLSv1.2</string>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <true/>
            <key>NSRequiresCertificateTransparency</key>
            <true/>
        </dict>
    </dict>
</dict>

Thanks in advance,

Replies

It’s hard to say what’s going on here without more info. Let’s start with APIs. Apple has two WebSocket APIs, one in URLSession and one in Network framework. Which are you using? Or are you perhaps using a third-party WebSocket implementation?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • We only use Unreal Engine 5 websocket interface so I would say third-party. Do you have any idea how we could make it work in this case ?

Add a Comment

We only use Unreal Engine 5 websocket interface so I would say third-party