I'm facing an issue with GCM device registration, but it seems to be limited to devices running Android version 5.0 (Lollipop).
I've been able to test push notifications successfully on all other devices except those running Lollipop. I am consistently getting the GCM SERVICE_NOT_AVAILABLE error.
I'm trying to run GCM.register(...)
from within my launcher activity. Again, this runs perfectly on all devices except those with Android Lollipop.
I've got all the correct manifest intent-filter actions and permissions (as are documented in many other posts).
Anyone have any ideas on what could be going wrong here?
Here is the AsyncTask
running the registration:
protected Object doInBackground(final Object... params) {
try {
String token = mGCM.register(getString(R.string.project_number));
Log.i("registrationId", token);
} catch (IOException e) {
Log.i("Registration Error ", e.getMessage());
}
return true;
}
@Override
protected void onPostExecute(Object o) {
super.onPostExecute(o);
// do something
}