# react-native-custom-tabs-shim

> wrap custom tabs

Latest version **1.1.0** (published 2022-09-22) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install react-native-custom-tabs-shim
pnpm add react-native-custom-tabs-shim
yarn add react-native-custom-tabs-shim
bun add react-native-custom-tabs-shim
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2022-09-22 |
| First published | 2019-02-02 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 72.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Your Name |
| Maintainers | jspaine |
| Keywords | react-native |

## Links

- npm: https://www.npmjs.com/package/react-native-custom-tabs-shim
- Repository: https://github.com/jspaine/react-native-custom-tabs-shim
- Homepage: https://github.com/jspaine/react-native-custom-tabs-shim#readme
- Issues: https://github.com/jspaine/react-native-custom-tabs-shim/issues
- npm.io page: https://npm.io/package/react-native-custom-tabs-shim

## Recent versions

- 1.1.0 (latest) — 2022-09-22
- 1.0.6 — 2021-09-18
- 1.0.4 — 2021-02-25
- 1.0.3 — 2021-02-25
- 1.0.2 — 2021-02-25
- 1.0.1 — 2019-02-02
- 1.0.0 — 2019-02-02

## README

# react-native-custom-tabs-shim

Wrapper for [react-native-custom-tabs](https://github.com/droibit/react-native-custom-tabs) that allows applinks to be opened in the native app.

It checks if a given url is supported by any extra apps compared to a baseline (http://example.com) and, if so, opens it directly instead.

## Getting started

`$ npm install react-native-custom-tabs-shim --save`

### Mostly automatic installation

`$ react-native link react-native-custom-tabs-shim`

### Manual installation


#### iOS

1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-custom-tabs-shim` and add `RNCustomTabsShim.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNCustomTabsShim.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`)<

#### Android

1. Open up `android/app/src/main/java/[...]/MainApplication.java`
  - Add `import com.reactlibrary.RNCustomTabsShimPackage;` to the imports at the top of the file
  - Add `new RNCustomTabsShimPackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
  	```
  	include ':react-native-custom-tabs-shim'
  	project(':react-native-custom-tabs-shim').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-custom-tabs-shim/android')
  	```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
  	```
      compile project(':react-native-custom-tabs-shim')
  	```

## Usage
```javascript
import * as RNCustomTabs from "react-native-custom-tabs"
import RNCustomTabsShim from "react-native-custom-tabs-shim"

const {CustomTabs, ANIMATIONS_FADE} = RNCustomTabsShim(RNCustomTabs)

const url = "https://www.netflix.com" // opens in netflix app
// const url = "https://example.com" // opens in custom tab

const options = {
  toolbarColor: '#607D8B',
  enableUrlBarHiding: true,
  showPageTitle: true,
  enableDefaultShare: true,
  animations: ANIMATIONS_FADE,
}

CustomTabs.openURL(url, options)
```

---
_Source: https://npm.io/package/react-native-custom-tabs-shim · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
