Skip to content

Using Firebase functions to receive data in real time using Lightbug's push system (through HTTP POST)

License

Notifications You must be signed in to change notification settings

lightbug-io/firestore-receiver-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firebase HTTPS receiver for Lightbug API quickstart

Introduction

The function lbListener is created to receive HTTP POST messages from LB API.

The URL of this function, eg:

https://us-central1-AAAA-BBBBB.cloudfunctions.net/lbListener

Should be used in the register_push example as the endpoint value

Further reading:

Initial setup, build tools and dependencies

1. Clone this repo

Clone or download this repo and navigate into the directory

2. Install the Firebase CLI and enable Functions on your Firebase CLI

You need to have installed the Firebase CLI. If you haven't run:

npm install -g firebase-tools

Doesn't work? You may need to change npm permissions.

Login to firebase (if not already done) using

firebase login

3. Create a Firebase project and configure the quickstart

Create a Firebase Project on the Firebase Console.

Set up your Firebase project by running firebase use --add, select your Project ID and follow the instructions.

Deploy the app to prod

First you need to install the npm dependencies of the functions:

cd functions && npm install; cd ..

This installs dependencies locally

Deploy to Firebase using the following command:

firebase deploy

This deploys and activates the lbListener Function.

The first time you call firebase deploy on a new project with Functions will take longer than usual.

View results

The example will create collections under /incoming - view data there

License

© Lightbug Ltd, 2020. Licensed under an Apache-2 license.

About

Using Firebase functions to receive data in real time using Lightbug's push system (through HTTP POST)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published