Skip to content

Commit 32b7fe5

Browse files
author
Brandon Huang
committed
Fix branch stuff
1 parent b226d16 commit 32b7fe5

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ _This feature is available only on Android._
106106

107107
Mark the current call as active (eg: when the callee has answered).
108108
Necessary to set the correct Android capabilities (hold, mute) once the call is set as active.
109+
Be sure to set this only after your call is ready for two way audio; used both incoming and outgoing calls.
109110

110111
```js
111112
RNCallKeep.setCurrentCallActive(uuid);

android/src/main/java/io/wazo/callkeep/VoiceConnection.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public void onAnswer() {
7777
Log.d(TAG, "onAnswer called");
7878

7979
setConnectionCapabilities(getConnectionCapabilities() | Connection.CAPABILITY_HOLD);
80-
setActive();
8180
setAudioModeIsVoip(true);
8281

8382
sendCallRequestToActivity(ACTION_ANSWER_CALL, handle);

android/src/main/java/io/wazo/callkeep/VoiceConnectionService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public Connection onCreateIncomingConnection(PhoneAccountHandle connectionManage
9696
String name = extra.getString(EXTRA_CALLER_NAME);
9797
Connection incomingCallConnection = createConnection(request);
9898
incomingCallConnection.setRinging();
99+
incomingCallConnection.setInitialized();
99100

100101
return incomingCallConnection;
101102
}
@@ -125,6 +126,7 @@ public Connection onCreateOutgoingConnection(PhoneAccountHandle connectionManage
125126
outgoingCallConnection.setDialing();
126127
outgoingCallConnection.setAudioModeIsVoip(true);
127128
outgoingCallConnection.setCallerDisplayName(name, TelecomManager.PRESENTATION_ALLOWED);
129+
outgoingCallConnection.setInitialized();
128130

129131
HashMap<String, String> extrasMap = this.bundleToMap(extras);
130132

@@ -159,7 +161,6 @@ private Connection createConnection(ConnectionRequest request) {
159161
List<Connection> conferenceConnections = new ArrayList<Connection>(otherConnections.values());
160162
connection.setConferenceableConnections(conferenceConnections);
161163

162-
connection.setInitialized();
163164
return connection;
164165
}
165166

index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ class RNCallKeep {
138138
};
139139

140140
updateDisplay = (uuid, displayName, uri) => {
141-
if (isIOS) {
142-
return;
143-
}
144141
RNCallKeepModule.updateDisplay(uuid, displayName, uri)
145142
}
146143

ios/RNCallKeep/RNCallKeep.m

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ - (void)dealloc
225225
[self.callKeepProvider reportOutgoingCallWithUUID:uuid connectedAtDate:[NSDate date]];
226226
}
227227

228-
RCT_EXPORT_METHOD(reportEndCallWithUUID:(NSString *)uuidString reason:(int)reason)
228+
RCT_EXPORT_METHOD(reportEndCallWithUUID:(NSString *)uuidString :(int)reason)
229229
{
230230
#ifdef DEBUG
231231
NSLog(@"[RNCallKeep][reportEndCallWithUUID] uuidString = %@ reason = %d", uuidString, reason);
@@ -246,7 +246,20 @@ - (void)dealloc
246246
}
247247
}
248248

249-
RCT_EXPORT_METHOD(setMutedCall:(NSString *)uuidString muted:(BOOL)muted)
249+
RCT_EXPORT_METHOD(updateDisplay:(NSString *)uuidString :(NSString *)displayName :(NSString *)uri)
250+
{
251+
#ifdef DEBUG
252+
NSLog(@"[RNCallKeep][updateDisplay] uuidString = %@ displayName = %@ uri = %@", uuidString, displayName, uri);
253+
#endif
254+
NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:uuidString];
255+
CXHandle *callHandle = [[CXHandle alloc] initWithType:CXHandleTypePhoneNumber value:uri];
256+
CXCallUpdate *callUpdate = [[CXCallUpdate alloc] init];
257+
callUpdate.localizedCallerName = displayName;
258+
callUpdate.remoteHandle = callHandle;
259+
[self.callKeepProvider reportCallWithUUID:uuid updated:callUpdate];
260+
}
261+
262+
RCT_EXPORT_METHOD(setMutedCall:(NSString *)uuidString :(BOOL)muted)
250263
{
251264
#ifdef DEBUG
252265
NSLog(@"[RNCallKeep][setMutedCall] muted = %i", muted);

0 commit comments

Comments
 (0)