request - google cloud messaging in android lower than 4.1 -


i'm using push notifications (gcm) in application , works correctly when run on android 4.2.2 (galaxy nexus , htc one)

also have tablet (asus transformer t101 running android 4.03) , nexus 1 (running android 2.3.6)

running application on tablet , nexus one, methods of push notifications not work.

as indicated in documentation, have included android.permission.get_accounts permission versions below 4.0.3, without success.

the method calls library of gcm runs:

final string regid = gcmregistrar.getregistrationid(hello.this);         if (regid.equals("")) {             gcmregistrar.register(hola.this, "my_id_sender"); //sender id                    } else {             log.i("masterhv", "already registered");         } 

but method handles response not executed (onregistered) ... understand there no response google

as said, works on devices android 4.2.2 , 4.1, permissions correct, not work on android 4.0.3 , lower.

i appreciate help.

thanks , regards

with old version of gcm (deprecated 1-2 month ago aprox.) had ask user add google account if running version lower 4.0.4

looking @ api docs still requirement

mobile device device running android application uses gcm. must 2.2 android device has google play store installed, , must have @ least 1 logged in google account if device running version lower android 4.0.4. alternatively, testing can use emulator running android 2.2 google apis.

gcm api

i have not used last version. if decide use old 1 have generate acces account settings add account:

private string[] getaccountnames() {                 accountmanager accman = accountmanager.get(this);         account[] accarray = accman.getaccountsbytype("com.google");         string[] names = new string[accarray.length];         (int = 0; < names.length; i++) {             names[i] = accarray[i].name;         }     return names; } 

so if array 0 can pop-up dialog asking move account settings.

without account if try register should see on logcat message error account_missing.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -