Reputation: 119
This is my first post, sorry my English
Hello every one. I am a new programmer in PHP and i would like to use Zend Mobile Framework to implement my push notificator server.
I'm searching how to implement the tomcat project used in
http://developer.android.com/guide/google/gcm/demo.html
but written in PHP.
In the code most below I written the used sources. When I call the submit button, always have response with InvalidRegistration error.
Can anyone see where the error?
Thank You very much
Upvotes: 0
Views: 6889
Reputation: 1011
One of the things that you are likely having happen here is the following:
Android Example
public class GCMIntentService extends GCMBaseIntentService {
public GCMIntentService() {
super(Constants.SENDER_ID);
}
@Override
protected void onRegistered(Context context, String regId) {
Log.i("MY_APP_TAG", "Registered: " + regId);
}
@Override
protected void onUnregistered(Context context, String regId) {
// write a call here to send the regId to your server and unregister it
}
@Override
protected void onMessage(Context context, Intent intent) {
Log.i("MY_APP_TAG", "Received message!");
// grabbing data looks like the following; the assumption
// is title is part of the data string.
String title = intent.getExtras().getString("title");
}
}
*Zend_Mobile_Push_Gcm Example*
See the updated link (http://pastebin.com/NhrD5N6i) I provided of your pasted code; you will want to use the registration ID above in the textbox.
Upvotes: 0
Reputation: 6690
According with Android GCM's architectural overview you have an invalidRegistration error when:
Invalid Registration ID Check the formatting of the registration ID that you pass to the server. Make sure it matches the registration ID the phone receives in the com.google.android.c2dm.intent.REGISTRATION intent and that you're not truncating it or adding additional characters. Happens when error code is InvalidRegistration.
Check the official GCM documentaion here, please.
Upvotes: 1