-->

GCM to FCM for Xamarin

2019-03-18 12:30发布

问题:

Xamarin has the predefined support to GCM (Google Cloud Messaging) which was explained in https://developer.xamarin.com/guides/cross-platform/application_fundamentals/notifications/android/remote_notifications_in_android/

As currently Google migrated from GCM to FCM (Firebase Cloud Messaging) does it work with Xamarin with same instruction or there any other Docs for integrating FCM with Xamarin?

Does all features provided in Firebase can be used in Xamarin App?

回答1:

does it work with Xamarin with same instruction?

No, it doesn't. But you can still work with GCM since Google hasn't announced that GCM support will stop just now. They just posted that FCM is the newest version of GCM.

there any other Docs for integrating FCM with Xamarin?

Not just yet, Xamarin doesn't have a guide about how to integrate FCM with your Xamarin.Android app.

Does all features provided in Firebase can be used in Xamarin App?

Yes, they can be used with Xamarin. But at this moment we have to wait until Xamarin provides us with official bindings(dlls) for FCM java libraries(jars) and probably they will post something in their blog about how to integrate this with our apps.

At this point, the best thing you can do while developing with Xamarin is use GCM. The other thing you can do, is create your own bindings with FCM java libraries and use Google's tutorial for android (in java)

While the last option will probably work, when the official Xamarin bindings come you will have to change a lot of code in order to make it work with upcoming updates from Google and Xamarin.

EDIT: as pointed out by @SørenBoisen Xamarin has started to rollout official(pre-release) bindings via nugget: https://www.nuget.org/packages/Xamarin.Firebase.Common/

More info at: Support for Google Firebase — Xamarin Forums



回答2:

The Firebase bindings are now available for Xamarin Android as a nuget package here: