/react-native-app-indexing

React Native integration of Google App Indexing

Primary LanguageJavaMIT LicenseMIT

react-native-app-indexing

NPM version

Integrates Google App Indexing with React Native.

Installation

$ npm install --save react-native-app-indexing

After installing the npm package you need to link the native modules. You can do so using rnpm.

$ rnpm link react-native-app-indexing

Then you will need to follow some extra steps.

Android

Add in the main activity of your manifest (android/app/src/mainAndroidManifest.xml) the following intent-filter.

<activity
    ...>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="http" />
        <data android:scheme="https" />
        <data android:host="www.YOUR-DOMAIN.com" />
    <intent-filter>
</activity>

You can obtain more info about how to add the intent-filter and it options in the following link.

iOS

iOS is not yet supported, please, feel free to send a pull request :D

Usage

Deep links

import AppIndexing from 'react-native-app-indexing'

Add App Indexing API

import AppIndexing from 'react-native-app-indexing'

License

This project is available under the MIT license. See the LICENSE file for more info.