Skip to content

React native linking android gives you a general interface to interact with outgoing app links.

License

Notifications You must be signed in to change notification settings

Upinion/react-native-linking-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-linking-android

React native linking android gives you a general interface to interact with outgoing app links.

Installation

npm install --save react-native-linking-android

or manually

git clone the directory to [node_modules/react-native-linking-android]

Add it to your android project

  • In android/setting.gradle
...
include ':LinkingAndroid', ':app'
project(':LinkingAndroid').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linking-android')
  • In android/app/build.gradle
...
dependencies {
    ...
    compile project(':LinkingAndroid')
}
  • register module (in MainActivity.java)
import com.upinion.LinkingAndroid.LinkingAndroidPackage;  // <--- import

public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
  ......

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mReactRootView = new ReactRootView(this);

    mReactInstanceManager = ReactInstanceManager.builder()
      .setApplication(getApplication())
      .setBundleAssetName("index.android.bundle")
      .setJSMainModuleName("index.android")
      .addPackage(new MainReactPackage())
      .addPackage(new LinkingAndroidPackage())              // <------ add here
      .setUseDeveloperSupport(BuildConfig.DEBUG)
      .setInitialLifecycleState(LifecycleState.RESUMED)
      .build();

 
  ......

}

Example

LinkingAndroid.show(uri)

Example:

var LinkingAndroid = require('react-native-linking-android');

LinkingAndroid.show('mailto:[email protected]');

About

React native linking android gives you a general interface to interact with outgoing app links.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published