Skip to content

Commit

Permalink
Improve installation of Android
Browse files Browse the repository at this point in the history
  • Loading branch information
droibit committed Sep 5, 2018
1 parent bc0d5b0 commit 8e3ac32
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@ react-native link react-native-custom-tabs

#### Android

In Android, Add it in your **root** `build.gradle` at the end of repositories:

```groovy
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```

ref. [example](https://github.com/droibit/react-native-custom-tabs/blob/develop/example/android/build.gradle#L25)

If you want to change the dependency version of this library, add the necessary properties to **root** `build.gradle`.

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

## Usage

Open the URL as `Linking` of React Native.
Open the URL like `Linking` of React Native.

```javascript
CustomTabs.openURL('https://www.google.com').then((launched: {boolean}) => {
CustomTabs.openURL('https://www.google.com').then(launched => {
console.log(`Launched custom tabs: ${launched}`);
}).catch(err => {
console.error(err)
Expand Down Expand Up @@ -109,7 +96,7 @@ CustomTabs.openURL(url, {
headers: {
"my-custom-header": "my custom header value"
},
forceCloseOnRedirection: true
forceCloseOnRedirection: true,
});
```

Expand Down
5 changes: 5 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
apply plugin: "com.android.library"

rootProject.allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}

def getRootExt(name, fallback) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : fallback
Expand Down
1 change: 0 additions & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ allprojects {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$projectDir/../../node_modules/react-native/android"
}
maven { url "https://jitpack.io" }
}
}

Expand Down

0 comments on commit 8e3ac32

Please sign in to comment.