File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1515#import < React/RCTLog.h>
1616
1717#import < AVFoundation/AVAudioSession.h>
18+ #import < CallKit/CallKit.h>
1819
1920#ifdef DEBUG
2021static int const OUTGOING_CALL_WAKEUP_DELAY = 10 ;
@@ -681,6 +682,7 @@ + (void)reportNewIncomingCall:(NSString *)uuidString
681682 RNCallKeep *callKeep = [RNCallKeep allocWithZone: nil ];
682683 [callKeep sendEventWithNameWrapper: RNCallKeepDidDisplayIncomingCall body: @{
683684 @" error" : error && error.localizedDescription ? error.localizedDescription : @" " ,
685+ @" errorCode" : error ? [callKeep getIncomingCallErrorCode: error] : @" " ,
684686 @" callUUID" : uuidString,
685687 @" handle" : handle,
686688 @" localizedCallerName" : localizedCallerName ? localizedCallerName : @" " ,
@@ -704,6 +706,21 @@ + (void)reportNewIncomingCall:(NSString *)uuidString
704706 }];
705707}
706708
709+ - (NSString *)getIncomingCallErrorCode : (NSError *)error {
710+ if ([error code ] == CXErrorCodeIncomingCallErrorUnentitled) {
711+ return @" Unentitled" ;
712+ } else if ([error code ] == CXErrorCodeIncomingCallErrorCallUUIDAlreadyExists) {
713+ return @" CallUUIDAlreadyExists" ;
714+ } else if ([error code ] == CXErrorCodeIncomingCallErrorFilteredByDoNotDisturb) {
715+ return @" FilteredByDoNotDisturb" ;
716+ } else if ([error code ] == CXErrorCodeIncomingCallErrorFilteredByBlockList) {
717+ return @" FilteredByBlockList" ;
718+ } else {
719+ return @" Unknown" ;
720+ }
721+ }
722+
723+
707724- (BOOL )lessThanIos10_2
708725{
709726 if (_version.majorVersion < 10 ) {
You can’t perform that action at this time.
0 commit comments