Start a new topic

Getting error while using push notification GCM - onError: INVALID_PARAMETERS

Good morning, I am Sandeep Armal trying to use kinvey with my app. I go through this and tried to learn and setup Kinvey in my project. So what i do

1. First i create account on Kinvey and get app_key and app_secret.

2. then i create app on Google Developer Console for Google Cloud Messagin from here . After creating app I got project_id and project_number then i create Android and server key.

3. Then I put project_number and adnroid_key(also tried with server key) here []( "")

So i though i done with getting keys and putting it so then I move to my client code.

i done all code which mentioned here

But when i run project i get ping success message but also i get

04-10 11:38:43.039: I/TEST(28709): GCM - onError: INVALID_PARAMETERS




android:versionName="1.0" >


android:targetSdkVersion="18" />


android:protectionLevel="signature" />




android:theme="@style/AppTheme" >


android:label="@string/app_name" >

android:name=".GCMReceiver" android:exported="true"

android:permission="" >





public class MainActivity extends Activity {

Client mKinveyClient = null;


protected void onCreate(Bundle savedInstanceState) {



mKinveyClient = new Client.Builder("kid_eV4yphmAnO", "066da3be5b264e55b1a7129c8db4dc3a"

, this.getApplicationContext()).build();

/** login and fire off the ping call to ensure we can communicate with Kinvey */


mKinveyClient.user().login(new KinveyUserCallback() {


public void onFailure(Throwable error) {

Log.e("TEST", "Login Failure", error);



public void onSuccess(User result) {

Log.i("TEST","Logged in a new implicit user with id: " + result.getId());



} KinveyPingCallback() {


public void onSuccess(Boolean result) {

Toast.makeText(MainActivity.this, "kinvey ping success!",




public void onFailure(Throwable error) {


"kinvey ping failed, check res/strings for appkey and appsecret",







MyGCMLoggingReceiver .java

public class MyGCMLoggingReceiver extends KinveyGCMService {


public void onMessage(String message) {

Log.i("TEST", "GCM - onMessage: " + message);



public void onError(String error) {

Log.i("TEST", "GCM - onError: " + error);



public void onDelete(int deleteCount) {

Log.i("TEST", "GCM - onDelete, message deleted count: " + deleteCount);



public void onRegistered(String gcmID) {

Log.i("TEST", "GCM - onRegister, new gcmID is: " + gcmID);



public void onUnregistered(String oldID) {

Log.i("TEST", "GCM - onUnregister");



public class GCMReceiver extends GCMBroadcastReceiver {


public String getGCMIntentServiceClassName(Context context){

return "com.donow.donow.MyGCMLoggingReceiver";



Sorry for big code but stuck from last three days. And really want to integrate Kinvey with my app.

Forgot one thing. i added all libs for Kinvey and gcm.jar also.

I thing i done all code from my side now if i send message from this link then I should get push notification

Looking forward for help.

Is there any thing which i forgot to setup?
Hi Sandip, @Edward‌ is going to take a look at this and see if there's something impacting the GCM service.
Hey Sandip.

INVALID_PARAMETERS is an error directly from google, which unfortunately isn't very well documented.

When you test this, are you running it on a physical device or an emulator? What version of android?

Also, can you try removing the empty white spaces after the sender id in ``? It might be an issue with our string parser, pulling in the spaces into the sender id.
Hi @Edward @caroline I am testing this on physical device Android OS version 4.2 Jelly Bean. There is no white spaces in `` file after parameters.
Hi Ed,

I also seem to be having a problem with GCM. None of the PUSH notifications are reaching my device even though console says its successfully sent. Tried both through custom BL code as well as using the "Send Push Notification" page from console.
We've noticed a bunch of issues for people using GCM. We're investigating now to see if something has changed about the API.
The problem is in the GCM library that Kinvey uses, it is obsolete since last year, you have to use Google Play Services for push functionality. Kinvey team should migrate to the new library ASAP before the old protocol stops working.
@camiloramirezqf Then how we can use Kinvey if they are not going to fix it? @caroline , @Edward

I do have an open ticket for upgrading the push implementation, and will be getting to it soon--

In the meantime, the current implementation is still supported by Google, and support has not been dropped. Still, there is a lot of configuration required on both the client side as well as on the google cloud console. The above configuration does look correct, and also ensure that there is a `gcm.jar` copied out of the `extras` directory from your android sdk into the `/libs` directory.

Assuming that is there, on the google cloud console ensure you have followed these steps:

1. Create a new project

2. Activate the `Google Cloud Messaging for Android` API, under the API & Auths Tab -> APIs

3. Under APIs & Auths Tab -> Credentials, create a new `Server Key`, and leave the allowed IP field blank.

4. Use this server key in your push configuration at

One last recommendation-- note that `onMessage` currently only writes to the logs, and it can be easily missed. Try adding the following code to your `onMessage` method:


NotificationCompat.Builder mBuilder =

new NotificationCompat.Builder(this)




NotificationManager mNotificationManager =

(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

@edward @caroline I add notification code along with Log but i am not able to even register user for GCM because following log is also not printed in LogCat.


public void onRegistered(String gcmID) {

Log.i("TEST", "GCM - onRegister, new gcmID is: " + gcmID);


Even i tried to check whether push notification functionality is enabled or not then i get `false`


I really want to use Kinvey but it's not working even in my sample app then how can i use it in my production build?.

BTW Thanks for your response time by time.. hope you will solve this issues asap.

Thank you..

so the issue here is "INVALID_PARAMETERS", coming from google.

Can you try registering directly? Note this is the same thing the library does, I am just curious as to what happens when you run it inside your application:

String curID = GCMRegistrar.getRegistrationId(currentApp);

GCMRegistrar.register(getApplication(), new String[]{"MY_GCM_ID"});

Can you post the value of curID after running the above code? Also, let me know if you still see the same issue with that direct call to register.
@Edward Thanks for your answer. Currently i am trying to create collection and get data from that collection.. will back on GCM next week. So will update you on this. Thank you.
@Edward Here is my CurId:-

`CUR ID = APA91bFjaEea6H2RjWu6vlehavc_5lrqyG--g2Puxim9JuIISmxdKlkRUpcg8oMpZnspqiULk9CavkfiL4MgYk5tEOvRwS9JxERvSz3FYA_d0-ZfhboqLuVJB48WfGgkCnSSRXsyPXsvorydF45toRi4CjiGl14OSw`
@Edward Awesome.... your new GCM registration code is working shamelessly... Perfect what i want..... Thank you!
Login or Signup to post a comment