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

merge original repo #1

Open
wants to merge 104 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
06cb30d
Fixes issue 406: Use Objective-C Key Value Coding(KVC) to sync _RTCEv…
May 3, 2022
1068ec6
Bump simple-plist from 1.0.0 to 1.3.1 in /example
dependabot[bot] Jun 2, 2022
de2016b
Fix warning in the ios documentation
MrHertal Aug 14, 2022
ba0c0b9
fix: missing Android RECORD_AUDIO permission
aguglie Oct 5, 2022
9f8398a
:memo: `didLoadWithEvents` is iOS only, fix anchors
homersimpsons Oct 13, 2022
ebecfec
:memo: Update `didChangeAudioRoute` documentation
homersimpsons Oct 14, 2022
e8afa6b
Bump react-native-reanimated from 1.1.0 to 2.10.0 in /example
dependabot[bot] Oct 20, 2022
b8ad50f
:pencil2: VoiceConnectionService: Update log to match reality
homersimpsons Nov 8, 2022
a38f71a
set audio mode back to normal after end call
Nov 21, 2022
4b6a2d1
Merge pull request #624 from homersimpsons/patch-3
sboily Nov 21, 2022
a920353
Merge pull request #616 from homersimpsons/patch-1
sboily Nov 21, 2022
e312594
Merge pull request #615 from aguglie/patch-1
sboily Nov 21, 2022
9108710
Bump decode-uri-component from 0.2.0 to 0.2.2 in /example
dependabot[bot] Dec 4, 2022
18fe9ed
Bump qs from 6.7.0 to 6.11.0 in /example
dependabot[bot] Dec 6, 2022
b5fcda1
Merge branch 'master' into patch-2
homersimpsons Jan 12, 2023
e629e32
Fixes speaker button on callkit
agustinferrari Jan 16, 2023
aa42fe2
4.3.4
manuquentin Jan 18, 2023
9be5bd3
Bump minimatch from 3.0.4 to 3.1.2 in /example
dependabot[bot] Jan 18, 2023
2c8c749
Merge pull request #651 from react-native-webrtc/dependabot/npm_and_y…
manuquentin Jan 18, 2023
0fe951b
Merge pull request #639 from react-native-webrtc/dependabot/npm_and_y…
manuquentin Jan 18, 2023
2ef96ac
Merge pull request #620 from react-native-webrtc/dependabot/npm_and_y…
manuquentin Jan 18, 2023
7c4c04b
Merge pull request #638 from react-native-webrtc/dependabot/npm_and_y…
manuquentin Jan 18, 2023
1c850e4
Merge pull request #584 from react-native-webrtc/dependabot/npm_and_y…
manuquentin Jan 18, 2023
188fc52
Allow foreground service notification to open the application
manuquentin Jan 20, 2023
68689ae
Enable phone settings for OnePlus without having to use self managed
kasperkberg Jan 24, 2023
338acdd
Bump ua-parser-js from 0.7.28 to 0.7.33 in /example
dependabot[bot] Jan 27, 2023
ddcebc5
Add event handler types
ramijarrar Jan 27, 2023
a5d650c
Avoid to call onSilence on Android API level < 29
manuquentin Jan 30, 2023
3c2e8d4
Merge pull request #658 from react-native-webrtc/fix_on_silence_metho…
manuquentin Jan 30, 2023
fb30581
Merge pull request #652 from react-native-webrtc/foreground_notificat…
manuquentin Jan 30, 2023
489a4c2
Merge pull request #618 from homersimpsons/patch-2
manuquentin Jan 30, 2023
df8649b
Merge pull request #657 from avorra/handler-types
manuquentin Jan 30, 2023
27d5533
Merge pull request #653 from drdropin-tech/master
manuquentin Jan 30, 2023
c855974
Merge pull request #649 from agustinferrari/fix-speaker-button-callkit
manuquentin Jan 30, 2023
b8eccd0
Merge pull request #604 from MrHertal/master
manuquentin Jan 30, 2023
1666694
Merge pull request #633 from saif-o99/audio_mode_fix
manuquentin Jan 30, 2023
74b1e7d
4.3.5
manuquentin Jan 30, 2023
b89cc59
Do not redirect to activity if not yet existing
manuquentin Jan 31, 2023
c1b2325
Merge pull request #659 from react-native-webrtc/check_activity
manuquentin Jan 31, 2023
3b4a4e8
4.3.6
manuquentin Jan 31, 2023
cd21ed0
Catch ArrayIndexOutOfBoundsException thrown by ReadableNativeMap.hasKey
manuquentin Feb 22, 2023
0ca9661
Catch (Foreground|Background)ServiceStartNotAllowedException
manuquentin Feb 22, 2023
9ac3051
add support for `CarAudio` I/O port
bradzickafoose Feb 28, 2023
4d6937e
Merge pull request #673 from bradzickafoose/master
manuquentin Feb 28, 2023
4a76c62
Merge pull request #669 from react-native-webrtc/fix_foreground_servi…
manuquentin Mar 1, 2023
b948a10
4.3.7
manuquentin Mar 1, 2023
1b59802
Move fetchStoredSettings outside of the RNCallKeepModule constructor …
manuquentin Mar 3, 2023
d20465f
Set isReceiverRegistered sooner in RNCallKeepModule to avoid double r…
manuquentin Mar 9, 2023
332abdd
Merge pull request #677 from react-native-webrtc/sooner_receiver_regi…
manuquentin Mar 21, 2023
114e740
Merge pull request #674 from react-native-webrtc/lighten_module_const…
manuquentin Mar 21, 2023
534ea32
4.3.8
manuquentin Mar 21, 2023
f805196
Adding support for multiple event listeners which also fixes memory l…
JoL0712 Apr 11, 2023
4c6b98e
Wrapping return output of addEventListener with convenience class for…
JoL0712 Apr 11, 2023
ed80a99
Create RNCallKeep instance for internal use and exporting.
JoL0712 May 2, 2023
55263b2
Merge pull request #655 from react-native-webrtc/dependabot/npm_and_y…
dependabot[bot] May 2, 2023
d784305
Update RNCallKeepModule.java
kasperkberg May 25, 2023
43561db
[example]: update App.js to remove heldCalls correctly
SuperBesse May 27, 2023
944cca9
Updated README.md with information about usage with expo
JorritKeijzer Jun 5, 2023
2d5ffa4
Update README.md
JorritKeijzer Jun 5, 2023
1fa33c6
Improve type definitions
ramijarrar Apr 21, 2023
d6be8ab
Merge pull request #697 from JorritKeijzer/patch-1
manuquentin Jun 9, 2023
39aea01
Merge pull request #695 from SuperBesse/patch-1
manuquentin Jun 9, 2023
1908a4d
Merge pull request #693 from kasperkberg/patch-1
manuquentin Jun 9, 2023
70059bd
Merge pull request #686 from avorra/types
manuquentin Jun 9, 2023
06d9543
Passing in RNCallKeep as argument for EventListener and removing inst…
JoL0712 Jun 9, 2023
0eb8f36
Merge branch 'master' into master
JoL0712 Jun 9, 2023
aa681cb
Merge pull request #683 from JoL0712/master
manuquentin Jun 9, 2023
6bb4372
4.3.9
manuquentin Jun 12, 2023
2beba86
Allow extra payload in displayIncomingCall and startCall
manuquentin Jun 16, 2023
5fda5b0
Add iOS setup options for overriding AVAudioSession setCategory optio…
manuquentin Jun 12, 2023
cff569c
Merge branch 'react-native-webrtc:master' into master
JoL0712 Jul 4, 2023
187c365
Adding javascript constants for AudioSessionCategoryOption and AudioS…
JoL0712 Jul 4, 2023
2d18d1f
Merge branch 'master' of https://github.com/JoL0712/react-native-call…
JoL0712 Jul 4, 2023
aa736eb
Update README.md (link fix)
jgarplind Jul 6, 2023
9344648
Merge pull request #711 from jgarplind/patch-1
manuquentin Jul 6, 2023
e61cd2a
Bump semver from 5.7.0 to 5.7.2 in /example
dependabot[bot] Jul 11, 2023
c3b907a
Make logging consistent by removing double bracket
jpotts18 Jul 17, 2023
d9d7250
Merge pull request #718 from jpotts18/master
manuquentin Jul 18, 2023
afedc2c
Add missing null argument in startCall override on Android
manuquentin Jul 31, 2023
e32cbf7
Merge pull request #700 from react-native-webrtc/add_call_payload
manuquentin Jul 31, 2023
a360c6d
Merge pull request #712 from react-native-webrtc/dependabot/npm_and_y…
manuquentin Jul 31, 2023
230bb73
Merge pull request #708 from JoL0712/master
manuquentin Jul 31, 2023
7725080
4.3.10
manuquentin Jul 31, 2023
b51f247
Do not expose payload as bridge argument for startCall and displayInc…
manuquentin Jul 31, 2023
6c37027
Merge pull request #721 from react-native-webrtc/fix_payload_argument
manuquentin Jul 31, 2023
4dabb11
4.3.11
manuquentin Jul 31, 2023
ef3d399
Merge pull request #574 from Paltap-io/fix/issue-406-rtceventemitter-…
manuquentin Aug 4, 2023
23d5810
Some bugs fixing and new code
Aug 15, 2023
71ae82e
Some bugs fixing and new code
Aug 15, 2023
ff52e5f
Changes requested from manuquentin
Aug 15, 2023
214959b
Changes requested from wilmxre
Aug 16, 2023
97f9a6a
Merge pull request #724 from saif-o99/master
manuquentin Aug 17, 2023
cc308ce
4.3.12
manuquentin Aug 17, 2023
c989733
Be more defensive when trying to wake the application
manuquentin Apr 10, 2024
d34d704
Stop listening to native calls when reporting ended call
manuquentin Apr 10, 2024
9570df1
Fix crash in getAudioOutput
manuquentin Apr 18, 2024
0eb9a5f
Merge pull request #769 from react-native-webrtc/stop_listening_phone…
manuquentin Apr 23, 2024
1f3cbfe
Merge pull request #772 from react-native-webrtc/fix_audio_output_crash
manuquentin Apr 23, 2024
a0d5c33
4.3.13
manuquentin Apr 23, 2024
ee6e42a
Use reactContent instead of getReactApplicationContext to avoid inval…
manuquentin Jul 9, 2024
25c382e
Merge pull request #794 from react-native-webrtc/fix_react_context
manuquentin Jul 10, 2024
85f0e79
4.3.14
manuquentin Jul 10, 2024
337d338
Update Android installation steps for Android 14 (target SDK 34) onwards
wkwiatek Aug 23, 2024
08034eb
Merge pull request #806 from wkwiatek/patch-1
manuquentin Sep 11, 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
78 changes: 59 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ For more information about **ConnectionService** on Android, please see [Android
- [Demo](#Demo)
- [Installation](#Installation)
- [Usage](#Usage)
- [Expo](#Usage-with-Expo)
- [Constants](#Constants)
- [Android Self Managed](#Android-Self-Managed-Mode)
- [API](#Api)
- [Example](##Example)
- [Example](#Example)
- [PushKit](#PushKit)
- [Android 11](#Android-11)
- [Debug](#Debug)
Expand Down Expand Up @@ -129,6 +130,11 @@ Alternative on iOS you can perform setup in `AppDelegate.m`. Doing this allows c
- `displayCallReachabilityTimeout`: number in ms (optional)
If provided, starts a timeout that checks if the application is reachable and ends the call if not (Default: null)
You'll have to call `setReachable()` as soon as your Javascript application is started.
- `audioSession`: object
- `categoryOptions`: AudioSessionCategoryOption|number (optional)
If provided, it will override the default AVAudioSession setCategory options.
- `mode`: AudioSessionMode|string (optional)
If provided, it will override the default AVAudioSession setMode mode.
- `android`: object
- `alertTitle`: string (required)
When asking for _phone account_ permission, we need to provider a title for the `Alert` to ask the user for it
Expand All @@ -155,6 +161,10 @@ Alternative on iOS you can perform setup in `AppDelegate.m`. Doing this allows c

You can alternatively just call `setSettings()` with the same option as `setup()` to define only your settings.

# Usage with Expo

To use this library with Expo, you will need to create a development build. Expo Go does not support custom native modules. For information on how to create and run a development build, visit: [Create a development build - Expo Documentation](https://docs.expo.dev/develop/development-builds/create-a-build/). You can use and test this library with a development build installed on your physical device (iOS and Android).

# Constants

To make passing the right integer into methods easier, there are constants that are exported from the module.
Expand Down Expand Up @@ -209,6 +219,7 @@ Self Managed calling apps are an advanced topic, and there are many steps involv
| [setForegroundServiceSettings()](#setForegroundServiceSettings) | `Promise<void>` | ❌ | ✅ |
| [canMakeMultipleCalls()](#canMakeMultipleCalls) | `Promise<void>` | ❌ | ✅ |
| [setCurrentCallActive()](#setCurrentCallActive) | `Promise<void>` | ❌ | ✅ |
| [checkIsInManagedCall()](#setAvailable) | `Promise<Boolean>` | ❌ | ✅ |
| [isCallActive()](#isCallActive) | `Promise<Boolean>` | ✅ | ❌ |
| [getCalls()](#getCalls) | `Promise<Object[]>` | ✅ | ❌ |
| [displayIncomingCall()](#displayIncomingCall) | `Promise<void>` | ✅ | ✅ |
Expand Down Expand Up @@ -306,6 +317,16 @@ RNCallKeep.setCurrentCallActive(uuid);
- `uuid`: string
- The `uuid` used for `startCall` or `displayIncomingCall`

### checkIsInManagedCall
_This feature is available only on Android._

Returns true if there is an active native call

```js
RNCallKeep.checkIsInManagedCall();
```


### isCallActive
_This feature is available only on IOS._

Expand Down Expand Up @@ -726,11 +747,12 @@ RNCallKeep.registerAndroidEvents();
| [didPerformSetMutedCallAction](#didPerformSetMutedCallAction) | ✅ | ✅ |
| [didToggleHoldCallAction](#didToggleHoldCallAction) | ✅ | ✅ |
| [didPerformDTMFAction](#didPerformDTMFAction) | ✅ | ✅ |
| [didLoadWithEvents](#didLoadWithEvents) | ✅ | |
| [didLoadWithEvents](#didLoadWithEvents) | ✅ | |
| [showIncomingCallUi](#showIncomingCallUi) | ❌ | ✅ |
| [silenceIncomingCall](#silenceIncomingCall) | ❌ | ✅ |
| [checkReachability](#checkReachability) | ❌ | ✅ |
| [didChangeAudioRoute](#didChangeAudioRoute) | ✅ | ✅ |
| [onHasActiveCall](#onHasActiveCall) | ❌ | ✅ |

### didReceiveStartCallAction

Expand All @@ -754,7 +776,7 @@ RNCallKeep.addEventListener('didReceiveStartCallAction', ({ handle, callUUID, na
- `name` (string)
- Name of the callee

### - answerCall
### answerCall

User answer the incoming call

Expand All @@ -767,7 +789,7 @@ RNCallKeep.addEventListener('answerCall', ({ callUUID }) => {
- `callUUID` (string)
- The UUID of the call that is to be answered.

### - endCall
### endCall

User finish the call.

Expand All @@ -780,7 +802,7 @@ RNCallKeep.addEventListener('endCall', ({ callUUID }) => {
- `callUUID` (string)
- The UUID of the call that is to be ended.

### - didActivateAudioSession
### didActivateAudioSession

The `AudioSession` has been activated by **RNCallKeep**.

Expand All @@ -791,7 +813,7 @@ RNCallKeep.addEventListener('didActivateAudioSession', () => {
});
```

### - didDisplayIncomingCall
### didDisplayIncomingCall

Callback for `RNCallKeep.displayIncomingCall`

Expand Down Expand Up @@ -821,7 +843,7 @@ RNCallKeep.addEventListener('didDisplayIncomingCall', ({ error, callUUID, handle
- `payload` (object)
- VOIP push payload.

### - didPerformSetMutedCallAction
### didPerformSetMutedCallAction

A call was muted by the system or the user:

Expand All @@ -835,7 +857,7 @@ RNCallKeep.addEventListener('didPerformSetMutedCallAction', ({ muted, callUUID }
- `callUUID` (string)
- The UUID of the call.

### - didToggleHoldCallAction
### didToggleHoldCallAction

A call was held or unheld by the current user

Expand All @@ -845,22 +867,26 @@ RNCallKeep.addEventListener('didToggleHoldCallAction', ({ hold, callUUID }) => {
});
```

### - didChangeAudioRoute
- `hold` (boolean)
- `callUUID` (string)
- The UUID of the call.

### didChangeAudioRoute

Triggered when the audio route has been changed.
⚠️ Will send `Speaker` on iOS but `SPEAKER` on Android.

```js
RNCallKeep.addEventListener('didChangeAudioRoute', ({ output }) => {

});
```

- `hold` (boolean)
- `callUUID` (string)
- The UUID of the call.
- `output` (string) ⚠️ Will send `Speaker` on iOS but `SPEAKER` on Android.
- `reason` (number, iOS only) See case's in https://developer.apple.com/documentation/avfaudio/avaudiosession/routechangereason
- `handle` (string, Android only) Phone number of the incoming caller
- `callUUID` (string, Android only) The UUID of the call

### - didPerformDTMFAction
### didPerformDTMFAction

Used type a number on his dialer

Expand All @@ -875,7 +901,7 @@ RNCallKeep.addEventListener('didPerformDTMFAction', ({ digits, callUUID }) => {
- `callUUID` (string)
- The UUID of the call.

### - didLoadWithEvents
### didLoadWithEvents

iOS only.

Expand All @@ -902,7 +928,7 @@ RNCallKeep.addEventListener('didLoadWithEvents', (events) => {
- `data`: object
Object with data passed together with specific event so it can be handled in the same way like original event, for example `({ callUUID })` for `answerCall` event if `name` is `RNCallKeepPerformAnswerCallAction`

### - showIncomingCallUi
### showIncomingCallUi

_Android only. Self Managed only._

Expand All @@ -923,7 +949,7 @@ The following values will match those initially passed to `displayIncomingCall`
- `name` (string)
- Caller Name.

### - silenceIncomingCall
### silenceIncomingCall

_Android only. Self Managed only._

Expand All @@ -944,7 +970,7 @@ The following values will match those initially passed to `silenceIncomingCall`
- `name` (string)
- Caller Name.

### - createIncomingConnectionFailed
### createIncomingConnectionFailed

_Android only. Self Managed only._

Expand All @@ -965,7 +991,7 @@ The following values will match those initially passed to `silenceIncomingCall`
- `name` (string)
- Caller Name.

### - checkReachability
### checkReachability

_Android only._

Expand All @@ -979,6 +1005,19 @@ RNCallKeep.addEventListener('checkReachability', () => {

```

### onHasActiveCall

_Android only._

A listener that tells the JS side if a native call has been answered while there was an active self-managed call

```js
RNCallKeep.addEventListener('onHasActiveCall', () => {
// eg: End active app call if native call is answered
});

```

## Example

A full example is available in the [example](https://github.com/react-native-webrtc/react-native-callkeep/tree/master/example) folder.
Expand Down Expand Up @@ -1104,6 +1143,7 @@ class RNCallKeepExample extends React.Component {
}
```


## Receiving a call when the application is not reachable.

In some case your application can be unreachable :
Expand Down
5 changes: 5 additions & 0 deletions actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const RNCallKeepShowIncomingCallUi = 'RNCallKeepShowIncomingCallUi';
const RNCallKeepOnSilenceIncomingCall = 'RNCallKeepOnSilenceIncomingCall';
const RNCallKeepOnIncomingConnectionFailed = 'RNCallKeepOnIncomingConnectionFailed';
const RNCallKeepDidChangeAudioRoute = 'RNCallKeepDidChangeAudioRoute';
const RNCallKeepHasActiveCall = 'RNCallKeepHasActiveCall';
const isIOS = Platform.OS === 'ios';

const didReceiveStartCallAction = handler => {
Expand Down Expand Up @@ -60,6 +61,9 @@ const didDisplayIncomingCall = handler => eventEmitter.addListener(RNCallKeepDid
const didPerformSetMutedCallAction = handler =>
eventEmitter.addListener(RNCallKeepDidPerformSetMutedCallAction, (data) => handler(data));

const onHasActiveCall = handler =>
eventEmitter.addListener(RNCallKeepHasActiveCall, handler);

const didToggleHoldCallAction = handler =>
eventEmitter.addListener(RNCallKeepDidToggleHoldAction, handler);

Expand Down Expand Up @@ -103,4 +107,5 @@ export const listeners = {
silenceIncomingCall,
createIncomingConnectionFailed,
didChangeAudioRoute,
onHasActiveCall
};
1 change: 1 addition & 0 deletions android/src/main/java/io/wazo/callkeep/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class Constants {
public static final String EXTRA_CALL_UUID = "EXTRA_CALL_UUID";
public static final String EXTRA_CALLER_NAME = "EXTRA_CALLER_NAME";
public static final String EXTRA_HAS_VIDEO = "EXTRA_HAS_VIDEO";
public static final String EXTRA_PAYLOAD = "EXTRA_PAYLOAD";
// Can't use telecom.EXTRA_DISABLE_ADD_CALL ...
public static final String EXTRA_DISABLE_ADD_CALL = "android.telecom.extra.DISABLE_ADD_CALL";

Expand Down
Loading