Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push Notification fails on Android when app closed #284

Closed
jperedadnr opened this issue Sep 30, 2021 · 4 comments
Closed

Push Notification fails on Android when app closed #284

jperedadnr opened this issue Sep 30, 2021 · 4 comments

Comments

@jperedadnr
Copy link
Contributor

jperedadnr commented Sep 30, 2021

This only happens when sending a push notification via Firebase Console, not using Firebase API (like CloudLink does).

When the app is running, push notifications are delivered just fine. However, if the app is closed the notification doesn't show up at the device, and this exception can be found:

E AndroidRuntime: FATAL EXCEPTION: Firebase-Messaging-Intent-Handle
E AndroidRuntime: Process: XXXXXX, PID: 27220
E AndroidRuntime: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process XXXXXX. Make sure to call FirebaseApp.initializeApp(Context) first.
E AndroidRuntime: 	at com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common@@19.3.0:184)
E AndroidRuntime: 	at com.google.firebase.messaging.MessagingAnalytics.logToScion(com.google.firebase:firebase-messaging@@20.3.0:99)
E AndroidRuntime: 	at com.google.firebase.messaging.MessagingAnalytics.logNotificationReceived(com.google.firebase:firebase-messaging@@20.3.0:2)
@websystemtechnology
Copy link

I have a similar problem with notifications on Android version 12 devices, in the app log I have this anomaly:
FirebaseApp: Default FirebaseApp failed to initialize because no default options were found. This usually means that com.google.gms:google-services was not applied to your gradle project.
I hope it will be useful to solve the problem.

@SamyNassiem
Copy link
Contributor

SamyNassiem commented Mar 4, 2024

I have the same issue and I am using Firebase admin API


`
[INFO] [SUB] W/ActivityManager( 4426): setHasOverlayUi called on unknown pid: 8943
[INFO] [SUB] D/GluonAttach(10864): [Custome Debug Message]: PushNotificationJobService : onStartJob()
[INFO] [SUB] I/GluonAttach(10864):  [Custome Debug Message]: From inside Attach: Gluon Attach PushNotification job has been triggered to start.
[INFO] [SUB] V/GluonAttach(10864): Gluon Attach PushNotification job has been triggered to start.
[INFO] [SUB] --------- beginning of crash
[INFO] [SUB] E/AndroidRuntime(10864): FATAL EXCEPTION: Firebase-Messaging-Intent-Handle
[INFO] [SUB] E/AndroidRuntime(10864): Process: xx.xxxx.xxxxx, PID: 10864
[INFO] [SUB] E/AndroidRuntime(10864): java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process  xx.xxxx.xxxxx. Make sure to call FirebaseApp.initializeApp(Context) first.
[INFO] [SUB] E/AndroidRuntime(10864): 	at com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common@@19.3.0:184)
[INFO] [SUB] E/AndroidRuntime(10864): 	at com.google.firebase.messaging.MessagingAnalytics.logToScion(com.google.firebase:firebase-messaging@@20.3.0:99)
[INFO] [SUB] E/AndroidRuntime(10864): 	at com.google.firebase.messaging.MessagingAnalytics.logNotificationReceived(com.google.firebase:firebase-messaging@@20.3.0:2)
[INFO] [SUB] E/AndroidRuntime(10864): 	at com.google.firebase.messaging.FirebaseMessagingService.passMessageIntentToSdk(com.google.firebase:firebase-messaging@@20.3.0:34)
[INFO] [SUB] E/AndroidRuntime(10864): 	at com.google.firebase.messaging.FirebaseMessagingService.handleMessageIntent(com.google.firebase:firebase-messaging@@20.3.0:27)
[INFO] [SUB] E/AndroidRuntime(10864): 	at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(com.google.firebase:firebase-messaging@@20.3.0:17)
[INFO] [SUB] E/AndroidRuntime(10864): 	at com.google.firebase.messaging.EnhancedIntentService.lambda$processIntent$0$EnhancedIntentService(com.google.firebase:firebase-messaging@@20.3.0:43)
[INFO] [SUB] E/AndroidRuntime(10864): 	at com.google.firebase.messaging.EnhancedIntentService$$Lambda$0.run(Unknown Source:6)
[INFO] [SUB] E/AndroidRuntime(10864): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
[INFO] [SUB] E/AndroidRuntime(10864): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
[INFO] [SUB] E/AndroidRuntime(10864): 	at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:6)
[INFO] [SUB] E/AndroidRuntime(10864): 	at java.lang.Thread.run(Thread.java:764)

`

@SamyNassiem
Copy link
Contributor

Update

I upgraded the Firebase libs, and it is working (until now :) )


    implementation 'com.google.gms:google-services:4.4.1'
    implementation 'com.google.firebase:firebase-messaging:23.4.1'

@jperedadnr
Copy link
Contributor Author

Fixed with #400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants