# @neft/firebase-messaging

> ## Installation

Latest version **1.0.0-alpha.1** (published 2019-07-13) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @neft/firebase-messaging
pnpm add @neft/firebase-messaging
yarn add @neft/firebase-messaging
bun add @neft/firebase-messaging
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-alpha.1 |
| Published | 2019-07-13 |
| First published | 2019-07-11 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 0 |
| Dependencies | 1 |
| Unpacked size | 21.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | kryskruk |

## Links

- npm: https://www.npmjs.com/package/@neft/firebase-messaging
- Homepage: http://neft.io
- npm.io page: https://npm.io/package/@neft/firebase-messaging

## Dependencies (1)

- [@neft/core](https://npm.io/package/@neft/core.md) ^1.0.0-alpha.1

## Recent versions

- 1.0.0-alpha.1 (latest) — 2019-07-13
- 1.0.0-alpha.0 — 2019-07-11

## README

# Neft Firebase Messaging

## Installation

Inside your Neft project type `npm install @neft/firebase-messaging` to install.

Created `google-services.json` file copy into `manifest/android/app` folder.

Created `GoogleService-Info.plist` file copy into `manifest/ios/app` folder.

## API

You can access the API by importing this extension.

```
const firebaseMessaging = require('neft-firebase-messaging')
```

### deviceToken

`firebaseMessaging.deviceToken` is a unique hash generated per each device.

In case of this hash refresh you need to listen a signal `firebaseMessaging.onDeviceTokenChange`.

### onMessageReceived

Received messages automatically generates a system notification only when your app is in background.

If your app is currently open by an user, the received message is accessible inside a `firebaseMessaging.onMessageReceived` signal.

```
const firebaseMessaging = require('neft-firebase-messaging')
firebaseMessaging.onMessageReceived.connect((event) => {
    console.log(`Title: ${event.title}`)
    console.log(`Body: ${event.body}`)
    console.log(`Data: ${JSON.stringify(event.data)}`)
})
```

---
_Source: https://npm.io/package/@neft/firebase-messaging · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
