firebase-cloud-messaging

Flutter - How to format title and body of notification in background?

百般思念 提交于 2021-02-11 15:01:42
问题 I am trying to display localized notification in flutter using firebase_messaging, I am getting a json with 3 language strings in body of a notification like so: {"it": "italian text", "de": "german text", "en": "english text"} As of now, it is showing the whole json string in the notification tray. How can I select the appropriate language text from the json and show in notification when app is in background? myBackgroundMessageHandler this function is never called. Thanks. 回答1: I could not

Flutter - How to format title and body of notification in background?

十年热恋 提交于 2021-02-11 14:59:19
问题 I am trying to display localized notification in flutter using firebase_messaging, I am getting a json with 3 language strings in body of a notification like so: {"it": "italian text", "de": "german text", "en": "english text"} As of now, it is showing the whole json string in the notification tray. How can I select the appropriate language text from the json and show in notification when app is in background? myBackgroundMessageHandler this function is never called. Thanks. 回答1: I could not

Ionic: Is it possible to delay incoming push FCM push notification from showing to my device until a specific time

与世无争的帅哥 提交于 2021-02-11 14:55:32
问题 So i am using Firebase for my project. And what is does is that every time a new record is added into a specific collection in Firestore, my Firebase Function will be triggered thus sending the push notification into the devices of users who are subscribe to a specific topic. Here is the code that i used for Firebase Function: exports.sendNotifications = functions.firestore .document('notifications/{sessionId}').onCreate(async event => { const newValue = event.data(); // Gets data from the

FCM and self-certificate issue (reopen)

主宰稳场 提交于 2021-02-11 14:49:13
问题 I'm using FCM to send a notification, my code works well when I use HTTP. The issue happened when I enable SSL using self-certificate, I cannot call subscribe/unsubscribe to/from a topic on FCM with error UNKOWN code. Any idea this issues please help I'm trying to debug so I can get access-token but cannot call sub/unsubscribe This is the request to get access-token 2020-12-02T16:06:24.192Z|2|INFO|fcm-demo|c5230eb4f07f582a,9b72559f0d3b8e39,true,|9|task-2|com.google.api.client.http

Firebase Cloud Functions get data on real time database onCreate

不打扰是莪最后的温柔 提交于 2021-02-11 14:31:07
问题 const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(); exports.sendNotification = functions.database.ref('/messages/diyetisyen/{uname}/{msgid}/message') .onCreate((snapshot, context) => { let message = snapshot.val(); let uname = context.params.uname; let root = snapshot.ref.root; let token = root.child('/users/' + uname + '/token').ref.token; let payload = { data: { custom_notification: JSON.stringify({ body: message + '', title:

Xamarin.Forms using Firebase Cloud Message to send notification [duplicate]

我的未来我决定 提交于 2021-02-11 13:49:16
问题 This question already has an answer here : How to setup FCM in Xamarin forms (1 answer) Closed 1 year ago . I'm need to send my Web API notification when user order something on my app, but i dont know how to send Notification to Firebase on Xamarin.Forms. Does anyone have some sample or source code to follow ? 回答1: You need to set up the Notification in specific Xamarin.Android project and Xamarin.iOS project. For Xamarin.Android : You can have a look at official document here and Remote

How to send notification to multiple device token using firebase cloud functions

筅森魡賤 提交于 2021-02-11 12:11:51
问题 I am new in using Firebase Cloud Functions and JavaScript and I was able to send notification to a single device using Firebase Cloud Functions(JavaScript). Now I am trying to send push notification to multiple device token and I think I have a problem on it. I want to send the notification to these device tokens in my firebase database: /receivers /event1 /uid1: device_token1 /uid2: device_token2 /uid3: device_token3 /uid4: device_token4 This is my code so far but it doesn't work.. exports

How to send notification to multiple device token using firebase cloud functions

烂漫一生 提交于 2021-02-11 12:10:12
问题 I am new in using Firebase Cloud Functions and JavaScript and I was able to send notification to a single device using Firebase Cloud Functions(JavaScript). Now I am trying to send push notification to multiple device token and I think I have a problem on it. I want to send the notification to these device tokens in my firebase database: /receivers /event1 /uid1: device_token1 /uid2: device_token2 /uid3: device_token3 /uid4: device_token4 This is my code so far but it doesn't work.. exports

React Native Push Notification Not Working Properly

北战南征 提交于 2021-02-11 12:03:33
问题 Push Notification function: PushNotification.configure({ largeIcon: "ic_launcher", smallIcon: "ic_notification", onNotification: function (notification) { PushNotification.localNotification({ autoCancel: true, message: 'Test Message', title: 'Test Message', vibrate: true, vibration: 300, playSound: true, soundName: 'default' }) console.log(notification) }, }); Problem: When I run application, if I send notification from php server I am getting response in console.log but condition 1:

What does FirebaseAppDelegateProxyEnabled do?

自古美人都是妖i 提交于 2021-02-11 05:09:15
问题 My issue (background notifications): I am using React Native Firebase. Everything is fine until recently I updated to version 6.7.1 of the library. After the update background notification(while app is closed) stopped working. Foreground is working. I found a suggestion here, to turn FirebaseAppDelegateProxyEnabled to YES in info.plist. And it did work! I can receive notifications fine now. But what is swizzling? I don't really understand what is this method of swizzling do, and what is the