firebase-cloud-messaging

onMessageReceived not called when app is in the background

我是研究僧i 提交于 2019-12-25 09:29:52
问题 When app is running and notification is alert if I click it, notification is go to there ( onMessageReceived is called) But when app is in background and notification is alert if I click it, onMessageReceived not called How to fix it? ps. sorry my english is not good. My code public class MyFirebaseMessagingService extends FirebaseMessagingService { String fnotification="0"; String post_id; String bage; String notification_id; String type; String message; private static final String TAG =

How to pass user context object to the response callback of async Jetty HTTP client?

拜拜、爱过 提交于 2019-12-25 09:22:17
问题 When sending notifications to single recipients over Google Firebase Cloud Messaging, sometimes a response comes back ( 200 + error:MissingRegistration , 200 + error:InvalidRegistration , 200 + error:NotRegistered ), which requires deleting the token of that recipient (because she for example reinstalled the Android app and the token has changed). My question is: How to pass that string (the FCM token) back to the response callback of the non-blocking Jetty HTTP client? Currently my

Azure Send Test Message To Android with FCM - Results in The Token obtained from the token provider is wrong

青春壹個敷衍的年華 提交于 2019-12-25 09:00:04
问题 I have configured a notification hub in Azure to send messages to Apple and Android devices. When sending test messages in the portal or VS.NET, the Apple messages go through with no problem, while the Android messages return an error message: The Token obtained from the Token from token provider is wrong. I double checked the API key to make sure that the one configured in the Azure notification hub is the correct server key from the Firebase Console under the Cloud Messaging tab. I see the

How to send Notifications to multiple users after an Event happened?

半城伤御伤魂 提交于 2019-12-25 08:57:59
问题 Hey I'm new to android and i made an application that enable the user to upload a file (Professor) so that Students can download it for educational purposes. I came to point that i want when the professor upload something to the application, I need the application to send a notification to the users notifying them that a new File is ready. I'm using Firebase and I want to know if there is an easy way to achieve that. 回答1: If you're using Firebase Database along with FCM, you could make use of

Converting/migrating from GCM to FCM for push notification

本秂侑毒 提交于 2019-12-25 08:37:05
问题 If I migrate my current GCM configuration to FCM what will happen to all the users of my Android app? Will I have to force all users to update or will the APK continue working as it is? Please guide me. Thanks in advance. 回答1: If you're simply referring to import your GCM project to Firebase, you should still be able to send messages to your users with GCM implemented apps (see my answer here). For migrating the app implementation from GCM to FCM, you don't necessarily have to force an update

Access data from Firebase Service in main thread

一曲冷凌霜 提交于 2019-12-25 08:28:36
问题 I am programming an app that receives some data from a FCM message, then updates the UI based on the data payload contained in the message. The service runs fine, and receives the data, but I cant figure out how to get it back to my main activity. The Firebase service is declared in my manifest as <service android:name=".MyFirebaseService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> In my MyFirebaseService class I have overridden

iOS FCM not getting push notifications

懵懂的女人 提交于 2019-12-25 08:16:46
问题 Since i updated to swift 3, FCM doesn't work. Push Notifications are enabled in Capabilities and Certificates are updated on Firebase console. Btw, fcm on android app works just fine, and it was working on ios but after update on swift 3 and new firebase libraries, it doesn't. AppDelegate.swift: class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? let notificationCenter = NotificationCenter.default var connectedToFcm: Bool = false func application(_ application:

Firebase cloud messaging conflict fb

守給你的承諾、 提交于 2019-12-25 08:15:08
问题 My project works well util I add FCM to build.gradle. The error here Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzr; My dependencies: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.google.firebase:firebase-messaging:9.4.0' ... compile 'com.facebook.android:facebook-android-sdk:[4,5)' compile 'com.facebook.android:audience-network-sdk:4.14.1

How to get the instance ID list of Firebase application via Web API?

旧时模样 提交于 2019-12-25 07:49:56
问题 I want to get a list of Registration Tokens from my Firebase application via Web API. How do I do it? An example of what I was thinking, below. Example POST request: https://iid.googleapis.com/iid/foooooooooooooHowDoIt Content-Type:application/json Authorization:key=API_KEY { "application": "com.iid.example_myapp" } Example result: HTTP 200 OK { "tokens": ["nKctODamlM4:CKrh_PC8kIb7O...", "1uoasi24:9jsjwuw..."], } Reference: https://developers.google.com/instance-id/reference/server 回答1: There

Push notifications works fine in development, but device not getting notification in production

烂漫一生 提交于 2019-12-25 07:15:34
问题 Ok, so I have an app that is in the app store. In development everything works fine I get all of the notifications that I send. I should mention that we are using Firebase for analyics and push notifications as we have a iOS and Android version of the app. Firebase account has both the correct development and correct production apns cert, the app's capabilities are set correctly to include push notifications and remote notifications in the background. In the organizer window the entitlement