firebase-cloud-messaging

Push notification is not receiving in iOS swift?

青春壹個敷衍的年華 提交于 2019-12-22 09:57:09
问题 I am using FCM for push notification. FCM is connected, device is registered successfully and I am able to print device token but the device is not receiving notification. In general -> capabilities tab -> enabled push notification and remote notification in back ground mode. Here registering device for remote notification. func application( _ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data ) { let trimEnds:String! = { deviceToken.description

Cannot add task ':processDebugGoogleServices' as a task with that name already exists

萝らか妹 提交于 2019-12-22 09:47:30
问题 I want to test firebase FCM plugin, but it seems to have a lot of errors, after solved many of them, here what I'm trying to do: ionic cordova build android , I have this error: my build.gradle of Android is: dependencies { classpath 'com.android.tools.build:gradle:2.2.1' classpath 'com.google.gms:google-services:3.1.0' } dependencies { compile fileTree(dir: 'libs', include: '*.jar') // SUB-PROJECT DEPENDENCIES START debugCompile(project(path: "CordovaLib", configuration: "debug"))

Angular Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script

霸气de小男生 提交于 2019-12-22 08:52:22
问题 I am doing Push notifications in Angular PWA with Firebase and I am following a link to do so. https://medium.com/@tariqueejaz/progressive-web-app-push-notifications-making-the-web-app-more-native-in-nature-a167af22e004 I am using Angular 6 and have setup the code for everything. when I am trying to run it, then it is showing me a pop up . After clicking on Allow button, it is throwing an error on console: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when

Cloud Functions for Firebase database onWrite triggered twice

牧云@^-^@ 提交于 2019-12-22 08:35:13
问题 Hi I am developing a notification system, but I am having trouble deleting the processed notification data. The onWrite event listener is triggered twice resulting to two notifications. Can you help me find a work around so that onWrite event listener should not be triggered twice? It is important to delete the processed data. exports.sendMessageNotification = functions.database.ref('/notification/message/{recipientUid}/{senderUid}').onWrite(event => { /* processing notification and sends FCM

Firebase Cloud Messaging device groups leak

孤人 提交于 2019-12-22 08:20:04
问题 I'm going to develop an app that uses device groups feature. As I understand I need to first send current registration token I get on Android client in method onTokenRefresh to the server and then add this registration token to proper device group (or create it if it doesn't exist) via HTTP request. I see, however, a potential for leaking registration tokens, as Android app user may for example wipe app's data multiple times. How to prevent it? What happens when a limit of 20 members is

cordova-plugin-fcm ERROR : invalid api key

倾然丶 夕夏残阳落幕 提交于 2019-12-22 05:59:24
问题 I am using cordova-plugin-fcm. I have followed the installation instruction: install plugin add the google-services.json to my root folder I wanted to test it through their testing server, but I get the error: ERROR: invalid api key The key I inserted was the one from the file google-service.json in the entry: "api_key": [{"current_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}] How can I do the testing properly? 回答1: When using FCM, you should always make use of the Server Key seen in the Cloud

App not showing Notification receiving FCM when the app is Open

放肆的年华 提交于 2019-12-22 05:17:23
问题 When I send a push from Firebase, if the app is in background or closed, I'm receiving the notification, but when the app is open not... Debugging I've observed that it's stopping in MyMessagingService specifically at onMessageReceived, so I guess that my problem is in regards of generating the notification (or maybe the intent which goes with the notification). I've implemented the service: public class MyMessagingService extends FirebaseMessagingService { private static final String TAG =

Send notification from the server to user segment who installed the app

假装没事ソ 提交于 2019-12-22 04:09:50
问题 In Firebase console, I saw the option to send a notification to User Segement with app "com.example" (where com.example is the app name). As the image shows: But how to do it from the server side using the FCM REST API: https://fcm.googleapis.com/fcm/send 回答1: Unfortunately, it is not possible to send messages to User Segments using the FCM REST API. As an alternative, you'll have to make use of the other ways to send messages to multiple devices, like simply using the registration_ids

Call method in a running activity from a service

筅森魡賤 提交于 2019-12-22 03:43:01
问题 I am currently working on a Android project. So far, I have implemented Firebase, in particular the FirebaseInstanceIdService and the FirebaseMessagingService: public class FirebaseIDService extends FirebaseInstanceIdService { private static final String TAG = "FirebaseIDService"; private Context context; @Override public void onTokenRefresh() { context = getApplicationContext(); // Get updated InstanceID token. String refreshedToken = FirebaseInstanceId.getInstance().getToken(); Log.e(TAG,

NotRegistered Response from FCM even when the app is installed on a users mobile device

扶醉桌前 提交于 2019-12-22 03:35:21
问题 We just migrated from GCM to FCM. For tracking uninstalls we send a silent notification to all our users and if we get a "NotRegistered" response we treat the user as uninstalled. Since the last few days, we started getting "NotRegistered" for some of the users who have not uninstalled the app. On querying the FCM diagnostics for the same Registration token the messages are being delivered but they are continuously in accepted state.Attached is the screenshot. The error code I received while