我正在尝试设置一个与GCM配合使用的应用程序,但每次都会出现phone_registration_error错误。根据Gcm文档,此错误的含义是:
但我不明白为什么我的设备不支持,我已经在真实的安卓设备和带有Google API的模拟器上进行了测试。
我的MainActivity:
Incorrect phone registration with Google.
This phone doesn't currently support GCM.
但我不明白为什么我的设备不支持,我已经在真实的安卓设备和带有Google API的模拟器上进行了测试。
我的MainActivity:
@Override
public void onCreate(Bundle savedInstanceState) {
checkNotNull(SENDER_ID, "SENDER_ID");
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
final String regId = GCMRegistrar.getRegistrationId(this);
Log.i(TAG, "registration id ===== "+regId);
if(regId.equals("")){
GCMRegistrar.register(this, SENDER_ID);
} else {
Log.v(TAG, "Already Registred");
}
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
我的清单: