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…
Rob,
Yes, I think because sample build.settings has “android.permission.GET_ACCOUNTS”.
Rob,
Sorry to keep pestering you.
How is it afterwards?
I can’t get google’s registration ID on CoronaSDK…?
Hi @ozawa. I’m not sure what you mean by “How is it afterwards?” How is what?
Can you summarize please:
Your app on Android 4.1 and later? Registration or No Registration?
Your app on Android 4.04? Registration or No Registration?
Your app on pre-Android 4.04? Registration or no Registration?
What about JonJohnson’s app?
Also read this thread and see if it helps any: http://forums.coronalabs.com/topic/32904-android-push-notifications-registration-and-unregister/
Rob,
Sorry, my English is not good.
I want to know what I can get registration ID on Android version less than 4.0.4.
Can you get ID on their OS?
>Your app on Android 4.1 and later? Registration or No Registration?
I can Registration.
>Your app on Android 4.04? Registration or No Registration?
I can’t Registration.
>Your app on pre-Android 4.04? Registration or no Registration?
I can’t Registration. I checked Android 2.3.4.
>What about JonJohnson’s app?
It’s same. I can get Registration ID only on Android 4.1.4.
These devices I checked is installed Google Play and set up Google account.
I can be downloaded apps on these devices from Google Play.
I want to know whether you can get registration ID on on Android version less than 4.0.4.
Now that we have narrowed this down to it doesn’t work on certain versions, the engineers have tracked down a problem in the latest public build (1137) that prevented this from working pre 4.1 of Android. This has been fixed in 1151 and has been retro-fixed to 1137. You do not need to download 1137 again, just rebuild and it will pick up the changes from the server and back to Android 2.2 should work.
Again: Public 1137 users, just rebuild. Daily Build people, pick up 1151.
Thanks for your patience on this.
Rob,
I rebuilt and I can get registration ID on Android version 4.0.4 !
I appreciate your prompt response.
Thanks.
I also have a 4.0.4 and just rebuilt and it’s working as well! How fabulous is that?
Thanks everyone!!!
Jen
can you post your build.settings and config.lua?
Thanks Rob. My project’s build.setting and config lua are as follos.
build.setting
–
settings = { orientation = { default = "portrait", supported = { "portrait", } }, iphone = { plist = { UIStatusBarHidden = true, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend -- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "----myFacebookUrlScheme-----", -- example scheme for facebook } } } } }, android = { permissions = { { name = ".permission.C2D\_MESSAGE", protectionLevel = "signature" }, }, usesPermissions = { "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.INTERNET", "android.permission.GET\_ACCOUNTS", "android.permission.RECEIVE\_BOOT\_COMPLETED", "com.google.android.c2dm.permission.RECEIVE", ".permission.C2D\_MESSAGE", "android.permission.BIND\_REMOTEVIEWS" }, }, }
config.lua
application = { content = { width = 640, height = 960, scale = "letterBox", fps = 30, --[[imageSuffix = { ["@2x"] = 2, } --]] }, -- Push notifications notification = { iphone = { types = { "badge", "sound", "alert" } }, google = {projectNumber = "----myProjectNumber---"} } }
in actuality, I set projectNumber I got Google Apis.
Do you need these permissions?
“android.permission.ACCESS_NETWORK_STATE”,
“android.permission.BIND_REMOTEVIEWS”
Have you looked at the console log (adb logcat) and put in some prints to see what’s happening?
>“android.permission.ACCESS_NETWORK_STATE”,
>“android.permission.BIND_REMOTEVIEWS”
These may not need…
I deleted these permissions.
But I don’t get “remoteRegistration” Event , yet…
I check ddms log.
I can’t found it like a trouble cause.
if Notifications/GooglePushNotifications sample is not move,
I have mistake Google’s set up?
I wrote main.lua as follows.
-- notification listener local function onNotification( event ) if event.type == "remoteRegistration" then native.showAlert( "send", event.token, { "OK" } ) elseif event.type == "remote" then native.showAlert( "remote", json.encode( event ), { "OK" } ) end end Runtime:addEventListener( "notification", onNotification )
Everything looks like it’s right. I’m not sure what could be the cause. There should be something in the logs.
I am also having the same problem.
My logfile shows the following error:
I/AppSecurityPermissions( 7815): Ignoring unknown permission:nl.questo.development.SampleBlank.permission.C2D_MESSAGE
I can see the packagename “nl.questo.development.SampleBlank” has been automatically inserted
Im using the debug keystore for building the project