我正在使用Google Cloud Messaging在Android手机上接收推送通知。我已经成功,一切似乎都很好。但是,Google建议检查Google Play服务是否更新到最新版本(因为推送通知是一项新功能)。推送通知的最低Google Play服务版本
使用Nexus 7(4.4.4)并在活动开始时启用版本检查由于存在较新版本,因此需要更新我的Google Play服务。但是,推送通知在没有更新的情况下可以正常工作如果不是绝对必要,我不希望我的用户更新Google Play服务。
我的问题:为了接收来自GCM的推送通知,我应该检查Google Play服务的最低版本是什么?
这是代码:
private boolean checkPlayServices() {
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (resultCode != ConnectionResult.SUCCESS) {
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
PLAY_SERVICES_RESOLUTION_REQUEST).show();
} else {
Log.i(TAG, "This device is not supported.");
finish();
}
return false;
}
return true;
}
备注:我不需要检查最新版本的谷歌Play的服务,但最低版本支持推送通知
编辑:我做了一些澄清由于意见
如果你不想要求用户拥有最新的谷歌Play服务,然后不要升级您的应用程序到最新版本 – tyczj 2014-09-30 17:22:54
你说它“危险” – danny117 2014-09-30 18:23:22
现在的任何解决方案,大卫? – Wayne 2015-02-07 17:55:46