React Native + Firebase #6 Send Push Notifications ( Expo + Firebase Cloud Functions)
Why Stack Overflow recommends it
Stack Overflow users link it when they are building Expo push notifications triggered by Firebase Cloud Functions and need a worked example to follow or debug against.
Recommended by 2 people across 2 different months, 2018 to 2021.
What it is
A 13-minute tutorial, part 6 of a React Native + Firebase series by the Unsure Programmer channel, showing how to send push notifications automatically with Expo and Firebase Cloud Functions. It uses the Firebase Realtime Database to store Expo push tokens and trigger notifications when new data is added, with project files on GitHub.
What people said
Recommends Rayhan Memon · 2019-01 · Stack Overflow · on “Can't deploy Firebase Cloud Function due to error with JSON.stringify() error”
I'm trying to deploy a cloud function for my react native app that sends a notification to users when a new node appears in the database. To do so, I'm using Expo's Push API as shown here: [LINK] and following a tutorial available here: [this video] I've been able to acquire device tokens and save them to my database just fine. However, I'm unable to deploy the function to my database because of an error that says: 31:27 Parsing error: Unexpected token, expected , It's throwing a fatal error at the line 'body: JSON.stringify(messages)' as if it expects a comma right after 'stringify'. I'm very unsure of how to proceed from here and can't seem to find any posts tackling this specific issue. Any he
Recommends user8398107 · 2020-05 · Stack Overflow · on “expo push notifications using firebase cloud functions in react native”
Seeing this tutorial on [this video] , I am trying to implement Send Push Notifications ( Expo + Firebase Cloud Functions) I'm trying to write a cloud function that will send a push notification to all devices in my database if another database entry is added the breakdown is... My user database is structured like this - any help or point in the right directions would be greatly appreciated, as I am still learning the whole thing. myFirestoreRealTimeDatabase |--messages |------fjdhfsjkf(**Unquiqe Message id**) |------------message: Test Push Notification | |--users |------EIDdxqEkm6YVRqV3p1x9FDXuX4C2 (**Unquiqe user id**) |------------email: myemail@email.com |------------expoToken: "ExponentPush
Cites user2128702 · 2018-11 · Stack Overflow · on “Can not get expo push token on Android”
I am building a React native app which is based on Expo [LINK] and I want to also take advantage of Expo's push notification capabilities in a combination with Firebase realtime database [LINK] . I am basically following the steps being described here [this video] . Everything was going pretty well before reaching the part where push notification token has to be extracted. registerForPushNotificationsAsync = async (userInfo) => { // ... Stuff // Get the token that uniquely identifies this device let token = await Notifications.getExpoPushTokenAsync(); console.log("Expo token: " + token); var updates = {} updates['/expoToken'] = token firebase.database().ref('Users').child(userInfo.user.uid).updat
Cites Uchiha Alchemist · 2021-03 · Stack Overflow · on “Sending push notifications in Expo React Native app to multiple devices at once?”
I'm still a newbie to React Native, but I am trying to integrate push notifications to my iOS & Android devices. Most tutorials I have seen with Expo use their website to push a notification using a specific token, but i do not want to do that. I want to send one notification to multiple devices at once (regardless of the OS on the device, aka iOS or Android). I think my best bet is doing it through Firebase, which is what this tutorial does [this video] . I also found the GitHub [LINK] that matches the tutorial, but they use ListView, which is now deprecated. I am getting the error that I cannot use ListView in that Github's code, and when I tried to switch it to a Flatlist, I'm getting an error
Cites Uchiha Alchemist · 2021-03 · Stack Overflow · on “Firebase Deploy causing multiple errors and not deploying”
Hello I am following this tutorial [this video] in order to do push notifications to multiple devices at once in Expo React Native using Firebase's cloud functions. The push tokens are stored in my RealTime-Database, but when I attempt to integrate this step after running firebase login and firebase init, I updated my index.js file to contain this code [LINK] . After saving this file, I attempt to do firebase deploy and I get 70 errors. I tried to deploy it from my app directory, and didnt work, and I tried to do it from my functions directory and that didn't work. I deleted my node_modules and package-lock, and I tried to rerun expo again and clearing my npm cache. Nothing worked. I already had