Crash when use OnlineSubsystemIOS

When I use Launcher Version Engine,and call CreateSession in BP,But FGameCenterSessionDelegateMC::initSessionWithName was Called,I think the reason is Launcher Version of OnlineSubsystemIOS are compiled with minimal os version > 7.0.

I found the source code from OnlineSessionInterfaceIOS.cpp:

FGameCenterSessionDelegateMC

  • (void)initSessionWithName:(NSString*) sessionName
    UE_LOG(LogOnline, Display, TEXT(“- (void)initSessionWithName:(NSString*) sessionName”));
    self.PeerID = [[MCPeerID alloc] initWithDisplayName:@“”];

Heare is MCPeerID Class Reference:

  • (instancetype)initWithDisplayName:(NSString *)myDisplayName
    This method throws an exception if the displayName value is too long, empty, or nil.

Application Crash

Hey xf-

Could you provide some additional information about the crash? It sounds like you created a CreateSession node in blueprints and crashed when you attempted to call it? What blueprint did you make this call in? Are you able to reproduce the crash in a new project without additional content? If so please include the steps that caused the crash. It would also be helpful if you could post the callstack from the crash as well as the log files.

Cheers

The reason is simple:
In OnlineSessionInterfaceIOS.cpp at funciton FGameCenterSessionDelegateMC::initSessionWithName,call the apple API: [[MCPeerID alloc] initWithDisplayName:@“”]
But the MCPeerID::initWithDisplayName throw Exception when pass empty string parameter.

the exception are not catch by application.Then it crash

I am not very familiar with the CreateSession node and need more information. Detailed reproduction steps along with the callstack and log files will help me test the crash and provide additional information for the developers fixing the bug.

Thank you.

I compiled engine from source,change the code [[MCPeerID alloc] initWithDisplayName:@“”] to [[MCPeerID alloc] initWithDisplayName:@“displayName”], the problem solved.
But I don’t think this is Standard solution,i won’t submit it.