I'm trying to use GCM with Mono for Android.
According to the Google Cloud Messaging getting-started guide, I should inherit com.google.android.gcm.GCMBaseIntentService
.
But I can't find this in Mono for Android. What should I do?
I'm trying to use GCM with Mono for Android.
According to the Google Cloud Messaging getting-started guide, I should inherit com.google.android.gcm.GCMBaseIntentService
.
But I can't find this in Mono for Android. What should I do?
You need to use a third-party library. I have done this successfully using PushSharp. Instructions on how to get started can be located on this page
https://github.com/Redth/PushSharp#pushsharpclientsamplemonoforandroid-
To expand on this answer, there is no official GCM library in Mono for Android currently. The GCM library is an Extra in the Android SDK, and that Extra has no official version in Mono for Android.
Since C2DM is deprecated, how is this possible? Two reasons:
First, there is an inofficial GCM library for Mono for Android. It's part of Push# and includes a port of the GCMBaseIntentService
and the GCMRegistrar
which come with the Java GCM library. These classes are direct ports of the Android SDK versions, so if you use them, you can follow the GCM getting-started guide.
Second, GCM is doable even without the actual GCM library. Under the hood it's very much like C2DM, with only a few modifications to the intents and permissions used. The GCM library in the Android SDK is just a bunch of helpers to handle GCM registration and GCM messages.