OnlineSessionIOS initialization crash and Find/Join issues

Our team is attempting to implement networked multiplayer for IOS, when we encountered an issue that seemed unresolved since 4.9:

Using a stock version of unreal 4.22.3, you cannot create a session for IOS without it crashing. After showing external login UI, logging into game center, and firing off the Create Session node, it will crash because of line 120 of OnlineSessionInterfaceIOS.cpp:

self.PeerID = [[[MCPeerID alloc] initWithDisplayName:@""] autorelease];

Apple’s Developer documentation on that method outright states that the display name cannot be an empty string, so it fails to create the PeerID and eventually crashes. See initWithDisplayName: | Apple Developer Documentation

In our locally compiled version of the Engine, we did attempt to use the fix in the Answer Hub thread I linked, however we ran into additional issues. Find Sessions will look through the list of sessions stored in GKSessions, but it never adds any sessions discovered on the network, only the one created locally in Create Session. When checking if sessions are available it is hardcoded to return NO, and Join Session seems completely unimplemented. (See OnlineSessionInterfaceIOS.cpp lines 140-166)

After encountering all these issues, we would like to know if there’s anything we did wrong or things we are missing, or if there are ways to resolve these issues.

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://epicsupport.force.com/unrealengine/s/

Thanks

Hello, we’re currently investigating this issue and we hope to have a solution for it relatively soon. I’ll update here as soon as I have a tested fix.

Additional question from the initial post: "I was also wondering, since one of the API’s that’s currently used is GKSession which is deprecated:

https://developer.apple.com/documentation/gamekit/gksession

(And the list of other deprecated APIs is here:)
https://developer.apple.com/documentation/gamekit/deprecated_symbols

Are y’all going to update the ios networking/matchmaking/etc API to the latest and greatest apple api or will the updates still use the old API?"

It looks like the iOS OSS implementation has atrophied, and isn’t functional in its current state. We are seeing similar issues here with our own sample apps. We have someone working on repairing the OSS in the short term, but I don’t have an ETA on when that work will be completed.

if “__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_0” it looks to be using MCSession instead of GKSession, but it doesn’t appear that the MCSession work is completed.

It may be worthwhile to (for the meantime) to modify the OnlineSessionInterfaceIOS files to set the instances where it says “#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0” to “#if 1”

and where it says “#ifdef __IPHONE_7_0” to “#if 0”

That will cause it to fall back to the GKSession API, which, although deprecated, looks to be functionally complete.

Any update on this? I cannot figure out what version of UE4 to test with what version of IOS to get a multiplayer test working. Using 4.23.0, absolutely nothing happens when an IOS device tries to connect to a server. So i built a test project in 4.22.3, now an IOS device begins to connect, the player shows up, but then the app crashes.

Any update on it? I just came across the same issue in 4.26. Can’t believe it is still an unsolved problem