React Native Plugin

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

2. Import plugin and register for push notifications

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

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

// this event is fired when the push is received in the app
DeviceEventEmitter.addListener('pushReceived', (e: Event) => {
  console.warn("pushReceived: " + JSON.stringify(e));
  // shows a push is received. Implement passive reaction to a push, such as UI update or data download.
});

// this event is fired when user clicks on notification
DeviceEventEmitter.addListener('pushOpened', (e: Event) => {
  console.warn("pushOpened: " + JSON.stringify(e));
  // shows a user tapped the notification. Implement user interaction, such as showing push details
});

3. In iOS Xcode project enable Push Notifications in the Capabilities section.

4.1 For Android project go to android/build.gradle and modify it as follows:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
  repositories {
    mavenLocal()
    jcenter()
    maven {
      // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
      url "$rootDir/../node_modules/react-native/android"
    }
    
    // ADD Maven repository here: 
    maven {
      url "https://maven.google.com"
    }
  }
}

4.2 Go to android/app/build.gradle and update compileSdkVersion and buildToolsVersion to 26+ version:

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
  	....
}

In the same file in dependencies section update all android support libraries to 26+ version:

dependencies {
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:26.1.0"
    compile "com.facebook.react:react-native:+"  // From node_modules
  	....
}

React Native Plugin