0.1.0 • Published 5 years ago

firebase-fcm-auth-tokens v0.1.0

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
5 years ago

Firebase FCM Auth Tokens

Automatically store FCM Tokens for Firebase Auth Users in Cloud Firestore.

npm version npm downloads

This library is a proof of concept, and very much a work in progress.

Installation

Firebase FCM Auth Tokens requires Firebase v5.0.0 or later.

npm install --save firebase-fcm-auth-tokens

Usage

// These Firebase libraries need to be enabled
import firebase from 'firebase/app';
import 'firebase/auth';
import 'firebase/firestore';
import 'firebase/messaging';

// Import this library
import fcmTokenSubscriber from 'firebase-fcm-auth-tokens';

// Subscribe a Firebase App and store FCM tokens in the `user-fcm-tokens` collection in Firestore
const unsubscribe = fcmTokenSubscriber(firebase.app(), 'user-fcm-tokens');

// Unsubscribe
unsubscribe();

Documentation

API

TODO

Security rules

TODO

0.1.0

5 years ago