React Native Android Module

Step 1 - Install plugin

npm install pushwoosh-react-native-plugin --save

Step 2 - Include pushwoosh plugin library project

In android/settings.gradle file, make the following changes:

include ':pushwooshplugin'
project(':pushwooshplugin').projectDir = new File(rootProject.projectDir, '../node_modules/pushwoosh-react-native-plugin/src/android')

In android/app/build.gradle add pushwooshplugin dependency:

dependencies {
    ...
    compile project(':pushwooshplugin')
}

In MainApplication.java add:

...
import com.pushwoosh.reactnativeplugin.PushwooshPackage;

public class MainApplication extends Application implements ReactApplication {

    ...

    @Override
    protected List<ReactPackage> getPackages() {
        return Arrays.<ReactPackage>asList(
            new MainReactPackage(),
            new PushwooshPackage() // register Pushwoosh plugin here
        );
    }
}

Step 3 - Use module

import Pushwoosh from 'pushwoosh-react-native-plugin';

Pushwoosh.init({ "pw_appid" : "YOUR_PUSHWOOSH_PROJECT_ID" , "project_number" : "YOUR_GCM_PROJECT_NUMBER" });
Pushwoosh.register();

React Native Android Module