Reputation: 49
In my app, when the user hits the "Active" button and sends the app to the background, a jingle will play while the app periodically checks for other available users in the background.
If an available user is found, the user hears a ping and a call should start.
However, I'm unable to create QBRTCSessions while the app is running in the background. I use the code below:
QBRTCSession *session = [QBRTCClient.instance createNewSessionWithOpponents:opponentsIDs withConferenceType:QBConferenceTypeVideo];
if (session) {
self.sessionQBRTC = session;
[session startCall:nil];
} else {
[SVProgressHUD showErrorWithStatus:@"Creating new session - Failure"];
}
Where 'opponenetsIDs' is the ID of the available user found while in the background. However, I am getting the "Creating new session - Failure" error. Any idea why?
Upvotes: 2
Views: 850
Reputation: 190
Maybe you forgot set the app permissions in "Capabilities" tab "Background Modes" and set the "Audio and AirPlay". Please check background mode
I have tested your code here and it works fine
Upvotes: 2