Google cloud messaging registration giving null error message in android app -
these 2 methods called within main activity, in onstart() , onstop() respectively.
private void registerformessages() { intent registrationintent = new intent("com.google.android.c2dm.intent.register"); registrationintent.putextra("app", pendingintent.getbroadcast(this, 0, new intent(), 0)); registrationintent.putextra("sender", "my project id"); startservice(registrationintent); } private void unregisterformessages() { intent unregintent = new intent("com.google.android.c2dm.intent.unregister"); unregintent.putextra("app", pendingintent.getbroadcast(this, 0, new intent(), 0)); startservice(unregintent); }
where "my project id" 12 digit project number google cloud messaging android enabled in google api console. both times these called, following log:
08-10 15:07:19.370: d/gcm(791): [c2dmregistrar.143] send register result null 0 0
i have manifest file set way have seen set others. receiver class never called anyway, error here in registration seems stop there. have idea error message telling me? kind of things causing error?
it's little confusing trying on android official guides, because of possibly referring deprecated methods, , instructions contradict each other - way, others want use register method it.
have on android push notifications using google cloud messaging (gcm), php , mysql http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
as per google’s documentation “google cloud messaging android (gcm) service helps developers send data servers android applications on android devices”. using service can send data application whenever new data available instead of making requests server in timely fashion. integrating gcm in android application enhances user experience , saves lot of battery power.
may you..
Comments
Post a Comment