Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): The getAudioRoutes changes the selected audio route #557

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a51cb74
fix(ios): The getAudioRoutes changes the selected audio route #540
rcidt Mar 31, 2022
1df080f
fix: [MOB-4845] Crashlytics: [__NSArray0 objectAtIndex:]: index 0 bey…
rcidt Aug 29, 2022
9498a35
First fore bluetooth tryout commit.
sasaobadicidt Oct 13, 2022
b49e6a7
Merge pull request #10 from coretech/force-bt
rcidt Oct 13, 2022
d6b763c
Additional flag fix if BT selected back as primary
sasaobadicidt Oct 14, 2022
b9a8c4b
Merge pull request #11 from coretech/force-bt
rcidt Oct 14, 2022
fcd5e06
Fixes audio routing issues on incoming calls when connected to BT
rcidt Oct 19, 2022
dcc5158
Adds localbroadcastmanager support
rcidt Nov 4, 2022
6965f41
Revert "Adds localbroadcastmanager support"
rcidt Nov 5, 2022
a2ca441
Sets fixed RN version
rcidt Nov 5, 2022
8caab0a
Adds group calling api
rcidt Dec 9, 2022
d837589
bug/MOB-5197: 3 way calling: Call is ended after tap merge button (A…
rcidt Jan 23, 2023
b80f36e
bug/MOB-5897: Phone sound gets activated instead of Speaker one after…
rcidt Sep 12, 2023
06dddf6
Adds missing js methods
rcidt Sep 13, 2023
8434364
bug/MOB-5329: iOS: No outbound call ringing sound when placing a call…
rcidt Jan 18, 2024
ac2e934
Merge branch 'master' into bug/MOB-5329
rcidt Jan 18, 2024
707055f
Merge branch 'callkit-fix'
rcidt Jan 18, 2024
c6beb0e
Merge branch 'master' into bug/MOB-5329
rcidt Jan 18, 2024
6228ac9
Update AndroidManifest.xml
rcidt Jul 12, 2024
48840d5
Update build.gradle
rcidt Jul 12, 2024
44378f7
Merge pull request #14 from net2phone/bug/MOB-5329
rcidt Jul 12, 2024
3d1bccf
Update build.gradle
rcidt Jul 12, 2024
df3c620
Fix no audio if app killed before call
janusz-kol Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const RNCallKeepDidDeactivateAudioSession = 'RNCallKeepDidDeactivateAudioSession
const RNCallKeepDidDisplayIncomingCall = 'RNCallKeepDidDisplayIncomingCall';
const RNCallKeepDidPerformSetMutedCallAction = 'RNCallKeepDidPerformSetMutedCallAction';
const RNCallKeepDidToggleHoldAction = 'RNCallKeepDidToggleHoldAction';
const RNCallKeepPerformGroupCallAction = 'RNCallKeepPerformGroupCallAction';
const RNCallKeepDidPerformDTMFAction = 'RNCallKeepDidPerformDTMFAction';
const RNCallKeepProviderReset = 'RNCallKeepProviderReset';
const RNCallKeepCheckReachability = 'RNCallKeepCheckReachability';
Expand Down Expand Up @@ -63,6 +64,9 @@ const didPerformSetMutedCallAction = handler =>
const didToggleHoldCallAction = handler =>
eventEmitter.addListener(RNCallKeepDidToggleHoldAction, handler);

const performGroupCallAction = handler =>
eventEmitter.addListener(RNCallKeepPerformGroupCallAction, handler);

const didPerformDTMFAction = handler =>
eventEmitter.addListener(RNCallKeepDidPerformDTMFAction, (data) => handler(data));

Expand Down Expand Up @@ -95,6 +99,7 @@ export const listeners = {
didDisplayIncomingCall,
didPerformSetMutedCallAction,
didToggleHoldCallAction,
performGroupCallAction,
didPerformDTMFAction,
didResetProvider,
checkReachability,
Expand Down
4 changes: 3 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def safeExtGet(prop, fallback) {
}

android {
namespace 'io.wazo.callkeep'
compileSdkVersion safeExtGet('compileSdkVersion', 28)

defaultConfig {
Expand All @@ -31,5 +32,6 @@ repositories {
}

dependencies {
implementation 'com.facebook.react:react-native:+'
implementation 'com.facebook.react:react-native:0.66.3'
implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.1.0"
}
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.wazo.callkeep">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"
Expand Down
10 changes: 10 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ declare module 'react-native-callkeep' {
'didDeactivateAudioSession' |
'didDisplayIncomingCall' |
'didToggleHoldCallAction' |
'performGroupCallAction' |
'didPerformDTMFAction' |
'didResetProvider' |
'checkReachability' |
Expand Down Expand Up @@ -144,6 +145,8 @@ declare module 'react-native-callkeep' {
*/
static isCallActive(uuid: string): Promise<boolean>

static isAudioSessionActive(): Promise<boolean>

static getCalls(): Promise<object>

static getAudioRoutes(): Promise<void>
Expand Down Expand Up @@ -175,6 +178,9 @@ declare module 'react-native-callkeep' {
static toggleAudioRouteSpeaker(uuid: string, routeSpeaker: boolean): void

static setOnHold(uuid: string, held: boolean): void

static setGroupCall(activeUuid: string, heldUuid: string): void
static setGroupCallFulfilled(): void

static setConnectionState(uuid: string, state: number): void

Expand All @@ -199,5 +205,9 @@ declare module 'react-native-callkeep' {
static setCurrentCallActive(callUUID: string): void

static backToForeground(): void

static configureVoiceAudioSession(): void

static configureVideoAudioSession(): void
}
}
24 changes: 24 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ class RNCallKeep {
addEventListener = (type, handler) => {
const listener = listeners[type](handler);

/**
* xxx https://idtjira.atlassian.net/browse/MOB-5329
*/
if (type === 'didActivateAudioSession') {
this.isAudioSessionActive().then(isActive => {
if (isActive) {
handler()
}
})
}

this._callkeepEventHandlers.set(type, listener);
};

Expand Down Expand Up @@ -170,6 +181,8 @@ class RNCallKeep {

isCallActive = async (uuid) => await RNCallKeepModule.isCallActive(uuid);

isAudioSessionActive = RNCallKeepModule.isAudioSessionActive;

getCalls = () => {
if (isIOS) {
return RNCallKeepModule.getCalls();
Expand Down Expand Up @@ -258,6 +271,9 @@ class RNCallKeep {
};

setOnHold = (uuid, shouldHold) => RNCallKeepModule.setOnHold(uuid, shouldHold);

setGroupCall = (activeUuid, heldUuid) => RNCallKeepModule.setGroupCall(activeUuid, heldUuid);
setGroupCallFulfilled = () => RNCallKeepModule.setGroupCallFulfilled();

setConnectionState = (uuid, state) => isIOS ? null : RNCallKeepModule.setConnectionState(uuid, state);

Expand Down Expand Up @@ -347,6 +363,14 @@ class RNCallKeep {
clearInitialEvents() {
return RNCallKeepModule.clearInitialEvents();
}

configureVideoAudioSession() {
return RNCallKeepModule.configureVideoAudioSession();
}

configureVoiceAudioSession() {
return RNCallKeepModule.configureVoiceAudioSession();
}
}

export default new RNCallKeep();
8 changes: 8 additions & 0 deletions ios/RNCallKeep/RNCallKeep.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@

@interface RNCallKeep : RCTEventEmitter <CXProviderDelegate>

@property(nonatomic,retain) NSTimer *forceBluetoothTimer;
@property BOOL shouldForceBluetooth;

@property (nonatomic, strong) CXCallController *callKeepCallController;
@property (nonatomic, strong) CXProvider *callKeepProvider;
@property (nonatomic, strong) CXSetGroupCallAction * callKeepGroupCallAction;

+ (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
Expand All @@ -44,7 +48,11 @@ continueUserActivity:(NSUserActivity *)userActivity
reason:(int)reason;

+ (BOOL)isCallActive:(NSString *)uuidString;
+ (BOOL)isAudioSessionActive;

+ (void)setup:(NSDictionary *)options;

+ (void)configureVoiceAudioSession;
+ (void)configureVideoAudioSession;

@end
Loading