Skip to content

Commit 8e3ac32

Browse files
committed
Improve installation of Android
1 parent bc0d5b0 commit 8e3ac32

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

README.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,6 @@ react-native link react-native-custom-tabs
3232

3333
#### Android
3434

35-
In Android, Add it in your **root** `build.gradle` at the end of repositories:
36-
37-
```groovy
38-
allprojects {
39-
repositories {
40-
...
41-
maven { url "https://jitpack.io" }
42-
}
43-
}
44-
```
45-
46-
ref. [example](https://github.com/droibit/react-native-custom-tabs/blob/develop/example/android/build.gradle#L25)
47-
4835
If you want to change the dependency version of this library, add the necessary properties to **root** `build.gradle`.
4936

5037
```
@@ -70,10 +57,10 @@ ref. https://developer.apple.com/documentation/uikit/uiapplication/1622952-canop
7057

7158
## Usage
7259

73-
Open the URL as `Linking` of React Native.
60+
Open the URL like `Linking` of React Native.
7461

7562
```javascript
76-
CustomTabs.openURL('https://www.google.com').then((launched: {boolean}) => {
63+
CustomTabs.openURL('https://www.google.com').then(launched => {
7764
console.log(`Launched custom tabs: ${launched}`);
7865
}).catch(err => {
7966
console.error(err)
@@ -109,7 +96,7 @@ CustomTabs.openURL(url, {
10996
headers: {
11097
"my-custom-header": "my custom header value"
11198
},
112-
forceCloseOnRedirection: true
99+
forceCloseOnRedirection: true,
113100
});
114101
```
115102

android/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
apply plugin: "com.android.library"
22

3+
rootProject.allprojects {
4+
repositories {
5+
maven { url "https://jitpack.io" }
6+
}
7+
}
38

49
def getRootExt(name, fallback) {
510
return rootProject.ext.has(name) ? rootProject.ext.get(name) : fallback

example/android/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ allprojects {
2222
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
2323
url "$projectDir/../../node_modules/react-native/android"
2424
}
25-
maven { url "https://jitpack.io" }
2625
}
2726
}
2827

0 commit comments

Comments
 (0)