I continue teaching IOT with Firebase through problem solving. In this video I'll show step by step guide to Setup Sensor Alert for Sending Push Notification to Android App by Using FCM (Firebase Cloud Messaging) & Pusher.In this tutorial we configure our android app and setup pusher notifications for sending manual Push Notifications in later tutorial we'll create a python script for sending automatic push notifications to android app if sensor detects any fire.
If you like videos like this consider donating $1, or simply turn off AdBlocker. Either helps me to continue making tutorials
Transcript / Cheat Sheet:
Circuit Diagram :
Above diagram connections:
Sensor A0 -> Node MCU Analog Pin
SENSOR alert LED -> Node MCU D5 Pin
Home Automation LED -> Node MCU D1 Pin
Arduino Code :
Firstly we need to add FCM to our app for that Navigate to Tools -> Firebase, under Cloud Messaging click Setup Firebase Cloud Messaging. Now follow Step 1 & Step 2 which will help in Connecting your app with Firebase & add FCM dependency to your app.
Navigate to App/build.gradle, add dependency for pusher-notification API .
Now sync your gradle file and Add Pusher Code to Main Activity.java which we get from pusher quick start guide.
Now build your gradle and Run app device & once compilation done you will get Continue option in pusher quick start guide after which we get code for sending push-notifications manually to our App.
Code Sample (run in terminal ) :