-
Notifications
You must be signed in to change notification settings - Fork 616
Enable FCM when Firebase project is dinamically initialised #4068
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
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hi @axionnneeeel, thanks for reporting. Could you share a few details below:
With these information, I'll try to reproduce this on my end. If there's any chance you could share a minimal reproducible example, that'll greatly help us investigating this. Thanks! |
Hi @argzdev
Some other info for a reproducible example: a. No google services JSON
c. Initialize app like The result: Push doesn't arrive Thanks |
Just to give some insights, the error you're receiving Thanks for the code snippet, I tried creating a clean minimal project with your setup, however, I'm still able to receive the push notification. I also didn't set Could you try the troubleshooting steps in our documentation? Let me know if it helps. Thanks! |
I tried the other way to test push notifs from the same menu like "Cloud Messaging -> Send your first message -> Add notification title and text -> Next -> Set as target my app -> Next -> Next -> Review -> Publish" and it's working that way. Any idea on why the "Send test message" way didn't work? |
Hi @axionnneeeel, if it works with a regular campaign, then there's no issue with your dynamic setup. However, it's possible that you're sending the test message to a different FCM registration token. You could also try testing on a physical device. I noticed that there are times where an emulator receives the notification late or not at all. If this still doesn't work, maybe you could take a look at our quickstart samples, you can also use it as a reference and compare the setup with your project. |
I am initializing Firebase dynamically with FirebaseApp.initializeApp(Builder) with all the project attributes set(including gcmSenderId), so I have no google services JSON in the project root as I'm choosing the firebase project at login. Everything works fine(auth sdk, firestore sdk, storage sdk etc.) apart from FCM. I'm getting the token successfully through onNewToken() method and then trying to send a test push to the token. I'm not getting the test push.
I've tried to set "firebase_messaging_auto_init_enabled" and "firebase_analytics_collection_enabled" to false and then after initializeApp to call FirebaseMessaging.getInstance().setAutoInitEnabled(true); but still doesn't work.
I can see in the logs that "Missing google_app_id. Firebase Analytics disabled. See ..." error is thrown so this may be the reason it's not working, but can't figure out why as google services json is missing intentionally and everything is fine after dynamically setting up Firebase.
The text was updated successfully, but these errors were encountered: