Call: Check permissions before accessing to the camera and the microphone.

It is particularly useful when a perm has been denied.
This commit is contained in:
manuroe
2016-07-29 17:59:59 +02:00
parent 764a299df1
commit f53190557f
2 changed files with 22 additions and 20 deletions
+17 -1
View File
@@ -1823,7 +1823,23 @@
- (void)roomInputToolbarView:(MXKRoomInputToolbarView*)toolbarView placeCallWithVideo:(BOOL)video
{
[self.mainSession.callManager placeCallInRoom:self.roomDataSource.roomId withVideo:video];
NSString *appDisplayName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
// Check app permissions before placing the call
[MXKTools checkAccessForCall:video
manualChangeMessageForAudio:[NSString stringWithFormat:[NSBundle mxk_localizedStringForKey:@"microphone_access_not_granted_for_call"], appDisplayName]
manualChangeMessageForVideo:[NSString stringWithFormat:[NSBundle mxk_localizedStringForKey:@"camera_access_not_granted_for_call"], appDisplayName]
showPopUpInViewController:self completionHandler:^(BOOL granted) {
if (granted)
{
[self.mainSession.callManager placeCallInRoom:self.roomDataSource.roomId withVideo:video];
}
else
{
NSLog(@"RoomViewController: Warning: The application does not have the perssion to place the call");
}
}];
}
- (void)roomInputToolbarView:(MXKRoomInputToolbarView*)toolbarView heightDidChanged:(CGFloat)height completion:(void (^)(BOOL finished))completion