Use Chrome Custom Tabs from React Native on Android
Switch branches/tags
Nothing to show
Clone or download
dstaley Fix for event emission
Sometimes (okay well most of the time) we’d try to send an event from
Java to React before React was ready to receive the event. This adds a
check to make sure that the React Context is ready. Downside is we lose
the initial connection event (since it happens before React is loaded),
but I’ll look into fixing that in the future.
Latest commit e396b84 Jan 9, 2016
Failed to load latest commit information.
android Fix for event emission Jan 9, 2016
.gitignore Initial commit Jan 9, 2016
.npmignore Initial commit Jan 9, 2016
ChromeCustomTabsClient.js Initial commit Jan 9, 2016 Fix GIF in README Jan 9, 2016
package.json Fix for event emission Jan 9, 2016


Demo of Chrome Custom Tabs in React Native


  1. npm install --save react-native-chrome-custom-tabs
  2. Add the following to android/settings.gradle:
include ':ReactNativeChromeCustomTabs', ':app'
project(':ReactNativeChromeCustomTabs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-chrome-custom-tabs/android')
  1. Add compile project(':ReactNativeChromeCustomTabs') to dependencies in android/app/build.gradle
  2. Import and register the module in your file:
import com.dstaley.ReactNativeChromeCustomTabs.ChromeCustomTabsPackage; // <-- Import

public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {

    private ReactInstanceManager mReactInstanceManager;
    private ReactRootView mReactRootView;

    protected void onCreate(Bundle savedInstanceState) {
        mReactRootView = new ReactRootView(this);

        mReactInstanceManager = ReactInstanceManager.builder()
                .addPackage(new MainReactPackage())
                .addPackage(new ChromeCustomTabsPackage(this))          // <-- Register

        mReactRootView.startReactApplication(mReactInstanceManager, "DemoReactNativeCustomTabs", null);



var ChromeCustomTabsClient = require('react-native-chrome-custom-tabs');

// Tell Chrome to preload a URL

// Launch a Custom Tab