Networking limitations in App Clips & P2P local WebRTC

I'm trying to do a very specific WebRTC setup in my app to stream media from a native app into a WKWebview, all purely on-device.

Since the environment is pretty controlled, I skip all the usual signalling server/handshake side of things, and just use loopback + a manual SDP (session description) exchange to get the connection started.

This works in the app, but not in the appclip. I assume there are some networking limitations (as the docs mention CFSockets and a few other networking features aren't available). Is there anywhere that specifies the full networking restrictions (or even better, whats allowed) inside App Clips?

I'm using Googles WebRTC framework, which I don't think requires any additional Apple Frameworks, but will be trying to open various ports etc. If I could know the restrictions present on App Clips I could likely find a workaround since I control the SDPs including setting what IP/port combo to use, and whether to use UDP/TCP.

Replies

The docs seem pretty clear here:

Advanced networking features like Bonjour and low-level networking APIs like CFSocket or POSIX functions aren’t available to App Clips. Instead, use URLSession or the Network framework.

“POSIX functions” refers to BSD Sockets.

I'm using Googles WebRTC framework, which I don't think requires any additional Apple Frameworks

I don’t understand what you mean by “additional Apple Frameworks” here. I suspect you mean that BSD Sockets isn’t part of such a framework. That’s true or false depending on your position regarding the System framework [1].

Regardless, if you’re using some cross platform code it’s likely to be based on BSD Sockets and thus subject to the restricted documented above.

Share and Enjoy

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

[1] The System framework does actually exist:

% ls -ld /System/Library/Frameworks/System.framework
drwxr-xr-x  6 root  wheel  192  1 Apr 17:46 /System/Library/Frameworks/System.framework

but it’s binary is a symlink to the libSystem.B.dylib shared library:

ls -l /System/Library/Frameworks/System.framework/Versions/Current/System
lrwxr-xr-x  1 root  wheel  43  1 Apr 17:46 /System/Library/Frameworks/System.framework/Versions/Current/System -> ../../../../../../usr/lib/libSystem.B.dylib