firebase-cloud-messaging

Android push notifications after device reboot

血红的双手。 提交于 2021-02-08 11:53:22
问题 I use the FirebaseMessagingService to handle incoming notifications. When my app is in the foreground and background the messages are being arrived. When I swipe-out the app, notifications are being arrived. But if I restart my device, notifications are not being arrived until I run my app. In the same way, Telegram and WhatsApp continue receiving notifications after reboot. I have implemented the onNewToken() method and have added logic to send new token to the server but it hasn't helped.

Schedule jobs in Firebase

假装没事ソ 提交于 2021-02-08 11:36:56
问题 I am assuming that someone has reserved 4:30 now and wants to save it to the server and notify the server from the server at 4:30. I do not want to use the alarm system built into the smartphone. I also watched Firebase cloud function lectures on YouTube and implemented them. And I've also seen CronJobs, which gets into the URL by alarm on time and executes the function. I have to set the time for the user and give an alarm to each individual. 回答1: There is no straight forward way of doing

Firebase: getting error: 'unable to find valid certification path to requested target' while syncing gradle project

一个人想着一个人 提交于 2021-02-08 10:25:23
问题 I want to add Firebase Cloud Messaging to my app. I'm trying to add a classpath to my build.gradle: 'com.google.gms:google-services:3.0.0' but when I want to sync it, I get this error: Error:Cause: unable to find valid certification path to requested target In logs report I found it: Gradle project resolve error org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.14.1-all.zip'. at org.gradle.tooling

onMessageReceived() not getting called when app is killed?

白昼怎懂夜的黑 提交于 2021-02-08 09:44:49
问题 I am using Firebase to send push notifications to my app. My app supports till API level 27.I am using FirebaseMessagingService to receive notifications. Inside onMessageReceived() method I am taking data payload and creating own notification in tray. From console I am sending only data payload since i dont want app to create system notifications if the app is in background. Now I am able to get callback in onMessageReceived() when app is in foreground and background. But the issue is its not

Notification does not show firebase Android 8

我只是一个虾纸丫 提交于 2021-02-08 08:32:08
问题 I have an app that is supposed to show a push notification but it doesn't this line new NotificationCompat.Builder(this); is canceled out in the code. I'm new to this, how can this work here is the code in FirebaseMessagingService.java class @Override public void onMessageReceived(RemoteMessage remoteMessage) { super.onMessageReceived(remoteMessage); sendNotification(remoteMessage.getNotification().getBody()); } private void sendNotification(String MessageBody){ Intent intent= new Intent(this

Firebase messaging.setBackgroundMessageHandler not receiving messages

白昼怎懂夜的黑 提交于 2021-02-08 08:23:44
问题 I am trying Firebase Cloud Messaging. It's awesome and all, but I am having the hardest time getting it to work for me. The problem I am facing is with the service worker, here is my firebase-messaging-sw.js : console.log('Service worker is loaded!'); self.addEventListener('install', function(event) { console.log('Service Worker is being installed.'); }); self.addEventListener('activate', function(event) { console.log('Service Worker is being activated.'); }); importScripts('https://www

Firebase messaging.setBackgroundMessageHandler not receiving messages

烈酒焚心 提交于 2021-02-08 08:22:20
问题 I am trying Firebase Cloud Messaging. It's awesome and all, but I am having the hardest time getting it to work for me. The problem I am facing is with the service worker, here is my firebase-messaging-sw.js : console.log('Service worker is loaded!'); self.addEventListener('install', function(event) { console.log('Service Worker is being installed.'); }); self.addEventListener('activate', function(event) { console.log('Service Worker is being activated.'); }); importScripts('https://www

Migrate from gcm to fcm in the server

眉间皱痕 提交于 2021-02-08 07:49:08
问题 in this article (https://developers.google.com/cloud-messaging/android/android-migrate-fcm#update-server-endpoints) it says that for migrating from gcm to fcm all you need to do in the server is change the endpoint. but how do i do this? currently i'm using gcm client library for Java. what exactly do i need to do? i couldn't find anywhere instruction how to update the endpoint. do i need to stop using the gcm client library and move to the fcm client library? 回答1: There is no FCM client

Migrate from gcm to fcm in the server

∥☆過路亽.° 提交于 2021-02-08 07:48:57
问题 in this article (https://developers.google.com/cloud-messaging/android/android-migrate-fcm#update-server-endpoints) it says that for migrating from gcm to fcm all you need to do in the server is change the endpoint. but how do i do this? currently i'm using gcm client library for Java. what exactly do i need to do? i couldn't find anywhere instruction how to update the endpoint. do i need to stop using the gcm client library and move to the fcm client library? 回答1: There is no FCM client

FCM token not generating in Samsung devices in release version of app

青春壹個敷衍的年華 提交于 2021-02-08 07:19:34
问题 I am using FCM for sending notifications in my app. The first version of my app is in the testing phase and there is an error in Samsung devices because FCM token is not getting generated in these devices. Here is my code which generates the token: FirebaseInstanceId.getInstance().instanceId.addOnCompleteListener(OnCompleteListener { task -> if (!task.isSuccessful) { return@OnCompleteListener } // Get new Instance ID token val token = task.result?.token val ref = FirebaseDatabase.getInstance(