Skip to content

Commit 53e37c4

Browse files
authored
readme: add manual link on android
1 parent 71dde43 commit 53e37c4

File tree

1 file changed

+38
-8
lines changed

1 file changed

+38
-8
lines changed

README.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,43 @@ you can find demo here: https://github.com/oney/RCTWebRTCDemo
3434
**from git package**: `npm install git://github.com/zxcpoiu/react-native-incall-manager.git`
3535

3636
===================================================
37-
#### android:
37+
### android:
3838

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

4242
We use android support library v4 to check/request permissions.
4343
You should add `compile "com.android.support:support-v4:23.0.1"` in `$your_project/android/app/build.gradle` dependencies on android.
4444

45-
**optional sound files on android**
45+
#### Manually Link
46+
47+
if rnpm link doesn't work. ( see: https://github.com/zxcpoiu/react-native-incall-manager/issues/21#issuecomment-279575516 )
48+
please add it manually in your main project:
49+
50+
1. in `android/app/build.gradle`
51+
should have a line `compile(project(':react-native-incall-manager'))` in `dependencies {}` section
52+
53+
2. in `android/settings.gradle`
54+
should have:
55+
```
56+
include ':react-native-incall-manager'
57+
project(':react-native-incall-manager').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-incall-manager/android')
58+
```
59+
60+
3. in `MainApplication.java`
61+
62+
```java
63+
import com.zxcpoiu.incallmanager.InCallManagerPackage;
64+
private static List<ReactPackage> getPackages() {
65+
return Arrays.<ReactPackage>asList(
66+
new MainReactPackage(),
67+
new InCallManagerPackage(),
68+
69+
);
70+
}
71+
```
72+
#### optional sound files on android
73+
4674
if you want to use bundled ringtone/ringback/busytone sound instead of system sound,
4775
put files in `android/app/src/main/res/raw`
4876
and rename file correspond to sound type:
@@ -57,13 +85,13 @@ on android, as long as your file extension supported by android, this module wil
5785
5886
===================================================
5987
60-
#### ios:
88+
### ios:
6189
6290
since ios part written in swift and it doesn't support static library yet.
6391
before that, you should add this project manually
6492
please do it step by step carefully :pray: :
6593
66-
- **Add files in to your project:**
94+
#### Add files in to your project:
6795
6896
1. Open your project in xcode
6997
2. find your_project directory under your project's xcodeproject root. ( it's a sub-directoory, not root xcodeproject itself )
@@ -72,11 +100,12 @@ please do it step by step carefully :pray: :
72100
* right click on your_project directory, `add files` to your project and add `node_modules/react-native-incall-manager/ios/RNInCallManager/`
73101
4. on the pou-up window, uncheck `Copy items if needed` and select `Added folders: Create groups` then add it. you will see a new directory named `RNInCallmanager under your_project` directory.
74102
75-
- **Setup Objective-C Bridging Header:**
103+
#### Setup Objective-C Bridging Header:
76104
1. click your `project's xcodeproject root`, go to `build setting` and search `Objective-C Bridging Header`
77-
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`
105+
2. set you header location, the default path is: `ReactNativeProjectRoot/ios/`,
106+
in this case, you should set `../node_modules/react-native-incall-manager/ios/RNInCallManager/RNInCallManager-Bridging-Header.h`
78107
79-
- **Clean project if messed up:**
108+
#### Clean project if messed up:
80109
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.
81110
82111
1. delete all project/directory in xcode related to incall-manager
@@ -88,7 +117,8 @@ please do it step by step carefully :pray: :
88117
89118
if someone knows a simpler way to set this project up, let me know plz.
90119
91-
**optional sound files on android**
120+
#### optional sound files on android
121+
92122
if you want to use bundled ringtone/ringback/busytone sound instead of system sound
93123
94124
1. add files into your_project directory under your project's xcodeproject root. ( or drag into it as described above. )

0 commit comments

Comments
 (0)