Search code examples
androidpush-notificationgoogle-play-servicesandroid-c2dm

Android GoogleApiAvailability SERVICE_VERSION_UPDATE_REQUIRED Can I get push token?


I always check the Google Api before register for push the device with the next fragment of code:

GoogleApiAvailability api = GoogleApiAvailability.getInstance();

int resultCode = api.isGooglePlayServicesAvailable(c);

if (resultCode != ConnectionResult.SUCCESS)
{
    return false;
}
else {

    return true;
}

Now I have a device with a pending update and I'm receiving the result: SERVICE_VERSION_UPDATE_REQUIRED (2). My question is: Is correct to asume that there is a valid google api service in this case?

Thanks!


Solution

  • I tested with a device unupdated and when I call instanceID.getToken throws a Time out exception, so I assumed that the connection result must be success to be able to get the token.