simple-fcm-push
v0.3.0
Published
Lib for send FCM push notifications
Downloads
2
Readme
simple-fcm-push
This library make FCM push simple
How to use
const fcmAuthToken = 'key=AAAAREhx2YM:APA91bHOSz3ix5CuoZUDuKfkgOZev2t_4cZ0756sO6PwK0FDLfk1j-9TuCc_loiqrqrueqwiojrlkjoiuqweqwejlkj';
const fcmToken = 'APA91bHOSz3ix5CuoZUDuKfkgOZev2t_4cZ0756sO6PwK0FDLfk1j-9TuCc_loiqrqrueqwiojrlkjoiuqweqwejlkj';
const notificationBody = {
body: 'body',
click_action: 'open',
icon: 'path_to_icon',
landing_page: 'landing_page',
title: 'title',
topic: 'topic',
};
// Send topic notification
sendTopicNotification(fcmAuthToken, notificationBody).subscribe(res => console.log(res));
// Send personal notification
sendPersonalNotification(fcmAuthToken, fcmToken, notificationBody).subscribe(res => console.log(res));