diff --git a/ios/RNCallKit/RNCallKit.m b/ios/RNCallKit/RNCallKit.m index b89c76a..1698f33 100644 --- a/ios/RNCallKit/RNCallKit.m +++ b/ios/RNCallKit/RNCallKit.m @@ -208,6 +208,12 @@ - (BOOL)lessThanIos10_2 } } +- (BOOL)containsLowerCaseLetter:(NSString *)callUUID +{ + NSRegularExpression* regex = [[NSRegularExpression alloc] initWithPattern:@"[a-z]" options:0 error:nil]; + return [regex numberOfMatchesInString:callUUID options:0 range:NSMakeRange(0, [callUUID length])] > 0; +} + - (int)getHandleType:(NSString *)handleType { int _handleType; @@ -366,7 +372,8 @@ - (void)provider:(CXProvider *)provider performAnswerCallAction:(CXAnswerCallAct if (![self lessThanIos10_2]) { [self configureAudioSession]; } - [self sendEventWithName:RNCallKitPerformAnswerCallAction body:@{ @"callUUID": action.callUUID.UUIDString }]; + NSString *callUUID = [self containsLowerCaseLetter:action.callUUID.UUIDString] ? action.callUUID.UUIDString : [action.callUUID.UUIDString lowercaseString]; + [self sendEventWithName:RNCallKitPerformAnswerCallAction body:@{ @"callUUID": callUUID }]; [action fulfill]; } @@ -376,7 +383,8 @@ - (void)provider:(CXProvider *)provider performEndCallAction:(CXEndCallAction *) #ifdef DEBUG NSLog(@"[RNCallKit][CXProviderDelegate][provider:performEndCallAction]"); #endif - [self sendEventWithName:RNCallKitPerformEndCallAction body:@{ @"callUUID": action.callUUID.UUIDString }]; + NSString *callUUID = [self containsLowerCaseLetter:action.callUUID.UUIDString] ? action.callUUID.UUIDString : [action.callUUID.UUIDString lowercaseString]; + [self sendEventWithName:RNCallKitPerformEndCallAction body:@{ @"callUUID": callUUID }]; [action fulfill]; }