Skip to content

Commit

Permalink
Merge pull request #1 from DanbiEduCorp/issue_outgoing_call
Browse files Browse the repository at this point in the history
[Fix] Outgoing calls from native call logs not working (generic, email)
  • Loading branch information
jrkim123us authored Dec 5, 2020
2 parents 3d646ea + 980148f commit add7266
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions ios/Classes/FlutterCallKitPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ + (CXProviderConfiguration *)getProviderConfiguration:(NSDictionary*)settings
providerConfiguration.supportsVideo = YES;
providerConfiguration.maximumCallGroups = 3;
providerConfiguration.maximumCallsPerCallGroup = 1;
providerConfiguration.supportedHandleTypes = [NSSet setWithObjects:[NSNumber numberWithInteger:CXHandleTypePhoneNumber], nil];
providerConfiguration.supportedHandleTypes = [NSSet setWithObjects:[NSNumber numberWithInteger:CXHandleTypeGeneric],[NSNumber numberWithInteger:CXHandleTypePhoneNumber], [NSNumber numberWithInteger:CXHandleTypeEmailAddress], nil];
if (settings[@"supportsVideo"]) {
providerConfiguration.supportsVideo = [settings[@"supportsVideo"] boolValue];
}
Expand All @@ -413,15 +413,15 @@ - (void)configureAudioSession
#ifdef DEBUG
NSLog(@"[FlutterCallKitPlugin][configureAudioSession] Activating audio session");
#endif

AVAudioSession* audioSession = [AVAudioSession sharedInstance];
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionAllowBluetooth error:nil];

[audioSession setMode:AVAudioSessionModeVoiceChat error:nil];

double sampleRate = 44100.0;
[audioSession setPreferredSampleRate:sampleRate error:nil];

NSTimeInterval bufferDuration = .005;
[audioSession setPreferredIOBufferDuration:bufferDuration error:nil];
[audioSession setActive:TRUE error:nil];
Expand All @@ -440,16 +440,21 @@ - (BOOL)application:(UIApplication *)application
NSString *handle;
BOOL isAudioCall;
BOOL isVideoCall;

//HACK TO AVOID XCODE 10 COMPILE CRASH
//REMOVE ON NEXT MAJOR RELEASE OF RNCALLKIT
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
//XCode 11
// iOS 13 returns an INStartCallIntent userActivity type
if (@available(iOS 13, *)) {
INStartCallIntent *intent = (INStartCallIntent*)interaction.intent;
isAudioCall = intent.callCapability == INCallCapabilityAudioCall;
isVideoCall = intent.callCapability == INCallCapabilityVideoCall;
if ([intent respondsToSelector:@selector(callCapability)]) {
isAudioCall = intent.callCapability == INCallCapabilityAudioCall;
isVideoCall = intent.callCapability == INCallCapabilityVideoCall;
} else {
isAudioCall = [userActivity.activityType isEqualToString:INStartAudioCallIntentIdentifier];
isVideoCall = [userActivity.activityType isEqualToString:INStartVideoCallIntentIdentifier];
}
} else {
#endif
//XCode 10 and below
Expand Down

0 comments on commit add7266

Please sign in to comment.