I don't get "remoteRegistration" Event

Rob,

I checked launchArgs but no “notification” property.

It maybe same case as below.

http://forums.coronalabs.com/topic/35139-corona-cloud-push-notifications/?p=182695

What properties are correct…?

launchArgs may not be set depending on the state of your app when the notification is interacted with.  launchArgs will only be set if your app is not running.  I don’t mean backgrounded.  I mean stopped, not in memory.  If you start your app by tapping it’s icon, launchArgs.notification won’t be set.   If you tap the notification and the OS starts your app code, then you get launchArgs.notification.  I’ve been testing it and it works (both on my Nexus 7 and my iPad 4).

If your app is in memory (in the foreground or background), launchArgs will not have a notfiication event.  Your app will however receive a notification event through the event handler and that event table will hold the notification content.

Thanks, Rob.

I understand the case of getting launchArgs.notification.

It’s when I tap device’s alert or notification, isn’t it?

Then, when can I get notification event that type is remoteRegistration?

I want to get Registration id, so I should get notification event.

Can you get notification event that type is remoteRegistration when launch your app?

And,

In My google API’s console Dashbord, 

Google Cloud Messaging for Android status is “No known issues”, is this no problem?

Did you ever figure this out? I’m seeing the same issue, my Android device isn’t ‘talking’ to GCM; e.g. I don’t see a print statement or alert after the remoteRegistration event, which seems to mean it’s not happening at all, and I see no activity for my Android device in the GCM console. Any solution?

jen,

Probably, My case is same your case.

My device get push notification from other apps.

My game needs Push notification,I am very troubled…

Rob,

Please tell me your CoronaSDK version.

I use Build 2013.1137.

I have this working OK, I can make a bare minimum GCM registration project, verify it works and send you guys. I think you probably tried everything but if you think it might help?

If you could post it on github I’d be grateful. I feel it’s either my Google setup or this dumb phone. Can you tell I am an iOs dev? :slight_smile:

Thanks jonjonsson.

I tried to create app by Android SDK use Google Cloud Messaging for Android Library, then I got Registration id.

I want to see your code, too…

Are your code same “Notifications/GooglePushNotifications” sample?

This is almost certainly a configuration problem.  There are multiple people who have it running, this code as been stable for months. 

Do you have Google Play installed on the device?

I can’t see your google setup.  I’ll investigate today and see if I can see any setup gotcha’s on their side.  There is nothing other than running your app and making sure you have the event listener running that would prevent you from getting the remoteRegistration event.

Yeah, I know. I do have Google Play on my newer Samsung SII phone, but that phone is not activated and I wonder if I need to get it on the Sprint network to properly talk to Google. I wasn’t excited about buying another data plan for a phone I’m not going to really use except for testing. I’m an iOs chick :wink:

Here is Corona project with bare minimum you need to get deviceID so less chance of mix up.

Also included compiled .apk file from that project that you can put on your device to test. (using my GCM, I promise I won’t spam you :slight_smile: ). If my apk file works and your apk from same project does not, I guess its overwhelming chance of cloud configuration problem. If my apk does not work, it is probably a device problem.

Only change you have to make is to Project number in config.lua.

https://dl.dropboxusercontent.com/u/45955/AndroidDeviceID.zip

ps. APK built using 2013.1142

It this is not working for you, please make sure you re-read this:

http://www.coronalabs.com/blog/2012/12/25/corona-holiday-gifts-android-push-and-more/

Make sure in your config.lua that your projectNumber is in quotes.  Make sure there are no funky characters like a space that sneaks into your app.

Visit the Google APIS site, find your project, click on services and make sure your GCM is on.

I would also like to see your registration handler function and your  code to enable the listener.

For what it’s worth, there are no changes to Google Push that I’m aware of in a while.  The latest daily and the latest publich should be the same here.

Thanks jonjonson, Rob.

I tried apk as bellow.

https://dl.dropboxusercontent.com/u/45955/AndroidDeviceID.zip

I got registration id Android OS 4.1.1.

But OS 4.0.4, 2.3.4 did not get it.

Only in Android OS 4.1 or higher, CoronaSDK I can get the Registration ID?

ozawa: if you are referring to the code in zip file, it will only work for Android. 

jonjonsson,

yes, I can get iOS Device token by my published other file.

I want to know about Android version.

Please tell me your android OS version.

AndroidDeviceID.apk did not work My GALAXY S3(OS 4.0.4).

I updated OS 4.0.4 to 4.1.2, it work ( I got registration ID).

Ah sorry, I misread. I’m on 4.2.2

ozawa: check http://developer.android.com/google/gcm/gcm.html

  • It requires devices running Android 2.2 or higher that also have the Google Play Store application installed, or or an emulator running Android 2.2 with Google APIs. However, you are not limited to deploying your Android applications through Google Play Store.
  • It uses an existing connection for Google services. For pre-3.0 devices, this requires users to set up their Google account on their mobile devices. A Google account is not a requirement on devices running Android 4.0.4 or higher.

Related to that, I found this while trying to find out the version requirements:

The android.permission.GET_ACCOUNTS permission as GCM requires a Google account (necessary only if if the device is running a version lower than Android 4.0.4)

jonjonsson,

I checked working GCM about 4.0.4 or lower.

http://developer.android.com/google/gcm/gs.html

When I use a device about 4.0.4 or lower,I must set a permission “android.permission.GET_ACCOUNTS”.

but I added that permission , and It added on your api, too.

I set up my google account on my devices, so I got registration ids on other apps build by Android SDK…