# firebots-react-native

> A react-native component for FireBots-Android

Latest version **0.0.3** (published 2019-10-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install firebots-react-native
pnpm add firebots-react-native
yarn add firebots-react-native
bun add firebots-react-native
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-10-22 |
| First published | 2019-10-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 97.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Moataz Hisham |
| Maintainers | mtzhisham |
| Keywords | react-native |

## Links

- npm: https://www.npmjs.com/package/firebots-react-native
- Repository: https://github.com/mtzhisham/FireBots-React-Native
- Homepage: https://github.com/mtzhisham/FireBots-React-Native#readme
- Issues: https://github.com/mtzhisham/FireBots-React-Native/issues
- npm.io page: https://npm.io/package/firebots-react-native

## Recent versions

- 0.0.3 (latest) — 2019-10-22
- 0.0.2 — 2019-10-22
- 0.0.1 — 2019-10-21

## README

# firebots-react-native

PushBots Assignment

## Install

`$ npm install firebots-react-native --save`

### Mostly automatic installation

`$ react-native link firebots-react-native`

### Manual installation


#### Android

In your React Native app:

1. open `android/gradle.properties` and add;
  	```gradle 
  	PushBotsAPIKey = "APP_API_KEY"
	PushBotsPlatformCode = "APP_Platform" 
  	
  	```
2. Update the following lines in `android/build.gradle` app module:
  	```gradle
  	buildToolsVersion = "29.0.2"
  	compileSdkVersion = 29
	targetSdkVersion = 29
  	```
3. In `android/build.gradle` add either `jcenter()` or `mavenCentral()`
  	```gradle
  	allprojects {
		repositories {
			...
			jcenter() //or mavenCentral()
			....
		}
	}
  	```
   	
4.	This module uses AndroidX  should add this lines in `android/gradle.properties`:
  	```gradle
      android.useAndroidX=true
	  android.enableJetifier=true
  	```



## Usage

in your App.js

```javascript
import React from 'react';

import FireBots from 'react-native-firebots-android';

class App extends React.Component {


  componentWillMount() {
    FireBots.addEventListener('FireBots_onMessageReceived', this.onReceived);
    FireBots.addEventListener('FireBots_onNotificationOpened', this.onClicked);
  }


  componentWillUnMount() {
    FireBots.addEventListener('FireBots_onMessageReceived', this.onReceived);
    FireBots.addEventListener('FireBots_onNotificationOpened', this.onClicked);
  }



  onReceived(notification) {
    console.log(notification)
  }


  onClicked(notification) {
    console.log(notification)

  }


}


export default App;

```

---
_Source: https://npm.io/package/firebots-react-native · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
