Search code examples
androidreact-nativepackagingreact-native-native-module

How to package an android native module for React Native


I wrote an android native module for a React Native app. I was wondering how would I package the module for private (i.e. my own apps or send them to someone to try) distribution ?

The module contains 1 native module (ReactContextBaseJavaModule) that starts an AppCombatActivity. The AppCombatActivity returns some results to the native module, then that module does some processing on the data returned and then returns it back to JS through the bridge.

Right now I am copying the activity and all its dependencies to the android directory in the React Native application and adding any Gradle dependencies to the Gradle file of React. Although this works, I don't feel it is a systematic way of packaging and installing the module.


Solution

  • Hi use this https://github.com/frostney/react-native-create-library command line Tool for creating library and push npm repository(private or public) How to publish to npm- https://docs.npmjs.com/misc/developers#create-a-user-account