Skip to content

Commit 71dde43

Browse files
authored
Update README for new API
1 parent 3a79c04 commit 71dde43

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

README.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Handling media-routes/sensors/events during a audio/video chat on React Native
88

99
## Purpose:
1010
The purpose of this module is to handle actions/events during a phone call (audio/video) on `react-native`, ex:
11-
* manage devices events like wired-headset plugged, proximity sensors and expose to javascript.
12-
* automatically route audio to proper device based on events and platform API.
13-
* toggle speaker or microphone on/off, toggle flash light on/off (not implemented yes)
11+
* manage devices events like wired-headset plugged in state, proximity sensors and expose functionalities to javascript.
12+
* automatically route audio to proper devices based on events and platform API.
13+
* toggle speaker or microphone on/off, toggle flash light on/off
1414
* play ringtone/ringback/dtmftone
1515

16-
basically, it is a telecommunication module which handle most of requirements when making/receiving/talking to a call.
16+
basically, it is a telecommunication module which handles most of requirements when making/receiving/talking with a call.
1717

1818
This module is desinged to work with [react-native-webrtc](https://github.com/oney/react-native-webrtc)
1919
you can find demo here: https://github.com/oney/RCTWebRTCDemo
@@ -39,14 +39,13 @@ you can find demo here: https://github.com/oney/RCTWebRTCDemo
3939
After install, you can use `rnpm` (`npm install rnpm -g`) to link android.
4040
use `rnpm link react-native-incall-manager` to link or manually if you like.
4141

42-
**optional sound files on android**
43-
if you want to use bundled ringtone/ringback/busytone sound instead of system sound
44-
4542
We use android support library v4 to check/request permissions.
4643
You should add `compile "com.android.support:support-v4:23.0.1"` in `$your_project/android/app/build.gradle` dependencies on android.
47-
48-
put files in `android/app/src/main/res/raw`
49-
and rename file correspond to sound type:
44+
45+
**optional sound files on android**
46+
if you want to use bundled ringtone/ringback/busytone sound instead of system sound,
47+
put files in `android/app/src/main/res/raw`
48+
and rename file correspond to sound type:
5049

5150
```
5251
incallmanager_busytone.mp3
@@ -56,13 +55,13 @@ incallmanager_ringtone.mp3
5655

5756
on android, as long as your file extension supported by android, this module will load it.
5857

59-
6058
===================================================
6159

6260
#### ios:
6361

6462
since ios part written in swift and it doesn't support static library yet.
65-
before that, you should add this project manually:
63+
before that, you should add this project manually
64+
please do it step by step carefully :pray: :
6665

6766
- **Add files in to your project:**
6867

@@ -77,6 +76,18 @@ before that, you should add this project manually:
7776
1. click your `project's xcodeproject root`, go to `build setting` and search `Objective-C Bridging Header`
7877
2. set you header location, the default path is: `ReactNativeProjectRoot/ios/`, in this case, you should set `../node_modules/react-native-incall-manager/ios/RNInCallManager/RNInCallManager-Bridging-Header.h`
7978

79+
- **Clean project if messed up:**
80+
The installation steps are a bit complex, it might related your xcode version, xcode cache, converting swift version, and your own path configurations. if something messed up, please folow steps below to clean this project, then do it again steps by steps.
81+
82+
1. delete all project/directory in xcode related to incall-manager
83+
2. delete `react-native-incall-manager` in node_modules ( rm -rf )
84+
3. Xcode -> Product -> clean
85+
4. close xcode
86+
5. npm install again
87+
6. open xcode and try the install process again steps by steps
88+
89+
if someone knows a simpler way to set this project up, let me know plz.
90+
8091
**optional sound files on android**
8192
if you want to use bundled ringtone/ringback/busytone sound instead of system sound
8293

@@ -263,6 +274,10 @@ note: ios only supports `auto` currently.
263274
| startRingtone(`ringtone: string, ?vibrate_pattern: array, ?ios_category: string, ?seconds: number`) | :smile: | :smile: | play ringtone. </br>`ringtone`: '_DEFAULT_' or '_BUNDLE_'</br>`vibrate_pattern`: same as RN, but does not support repeat</br>`ios_category`: ios only, if you want to use specific audio category</br>`seconds`: android only, specify how long do you want to play rather than play once nor repeat. in sec.|
264275
| stopRingtone() | :smile: | :smile: | stop play ringtone if previous started via `startRingtone()` |
265276
| stopRingback() | :smile: | :smile: | stop play ringback if previous started via `start()` |
277+
| setFlashOn(`enable: ?boolean, brightness: ?number`) | :rage: | :smile: | set flash light on/off |
278+
| async getIsWiredHeadsetPluggedIn() | :rage: | :smile: | return wired headset plugged in state |
279+
280+
266281

267282
**Events**
268283

0 commit comments

Comments
 (0)