I am trying to run this sample app:
And get the error
Java.Lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.xamarin.fcmexample.
Make sure to call FirebaseApp.initializeApp(Context) first. occurred
So I added the call
FirebaseApp.InitializeApp(this);
at the end of the OnCreate, removed the bin/obj folders, rebuild and re-deployed (multiple times) but the exception will not go away. Is there a Xamarin demo app for Android 8.0/8.1 that can receive FCM notifications without crashing?
Answers
I have tested the sample app of the link you post, and the sample could been built normally , and been deployed to my device (Google Pixel Android 8.1) without crashing.
This is just a code sample, if we want to receive FCM notifications, we need to acquire the necessary credentials to use Google's servers. In the sample link , we can see the following note
You could try to follow Firebase Cloud Messaging to achieve yourself FCM notifications.
Of course , when we create our own app, we can use the key code of the sample app.
Note: when you download the google-services.json file from project console, and make sure to set the Build Action of "GoogleServicesJson" to

GoogleServicesJson
, just as follows.Hope it can help you.
I already did all that. I created a new google app to match the Firebase sample (same package name, application name) and now the sample runs without errors at least. [So the error is very misleading about what the problem actually is.]
Anyway, I can now get a token and subscribe. But Google can seem to see my app:
That never finishes. So I can't get to the firebase console to send a test notification
I'm going to close this and start a new topic