Skip to content

Commit b85dc00

Browse files
authored
Merge pull request #34 from aarkalyk/contact-identifier-added
ContactIdentifier added to startCall action.
2 parents d0d7047 + 4211274 commit b85dc00

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ Initialise RNCallKit with options
134134
- generic
135135
- number (default)
136136
- email
137+
- **localizedCallerName**: string (optional)
137138

138139
Call when you receive incoming calls to display system UI
139140

@@ -145,6 +146,8 @@ Call when you receive incoming calls to display system UI
145146
- generic
146147
- number (default)
147148
- email
149+
- **contactIdentifier**: string (optional)
150+
- The identifier is displayed in the native call UI, and is typically the name of the call recipient.
148151

149152
Call when you make an outgoing call
150153

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ export default class RNCallKit {
7171
_RNCallKit.displayIncomingCall(uuid, handle, handleType, hasVideo, localizedCallerName);
7272
}
7373

74-
static startCall(uuid, handle, handleType = 'number', hasVideo = false) {
74+
static startCall(uuid, handle, handleType = 'number', hasVideo = false, contactIdentifier?: String) {
7575
if (Platform.OS !== 'ios') return;
76-
_RNCallKit.startCall(uuid, handle, handleType, hasVideo);
76+
_RNCallKit.startCall(uuid, handle, handleType, hasVideo, contactIdentifier);
7777
}
7878

7979
static reportConnectedOutgoingCallWithUUID(uuid) {

ios/RNCallKit/RNCallKit.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ - (void)dealloc
114114
}
115115

116116
RCT_EXPORT_METHOD(startCall:(NSString *)uuidString
117-
handle:(NSString *)handle
118-
handleType:(NSString *)handleType
119-
video:(BOOL)video)
117+
handle:(NSString *)handle
118+
handleType:(NSString *)handleType
119+
video:(BOOL)video
120+
contactIdentifier:(NSString * _Nullable)contactIdentifier)
120121
{
121122
#ifdef DEBUG
122123
NSLog(@"[RNCallKit][startCall] uuidString = %@", uuidString);
@@ -126,6 +127,7 @@ - (void)dealloc
126127
CXHandle *callHandle = [[CXHandle alloc] initWithType:_handleType value:handle];
127128
CXStartCallAction *startCallAction = [[CXStartCallAction alloc] initWithCallUUID:uuid handle:callHandle];
128129
[startCallAction setVideo:video];
130+
[startCallAction setContactIdentifier:contactIdentifier];
129131

130132
CXTransaction *transaction = [[CXTransaction alloc] initWithAction:startCallAction];
131133

0 commit comments

Comments
 (0)