I'm updating my Android app to use the new Urban Airship library which supports Google Cloud Messaging.
I did the following:
Sign up for a GCM API key.
Go to Settings : Services : Configure GCM, add the API key and put in the package name for our app.
Update the client library from 1.1.3 to 3.0.0 (yes, I know, ouch!)
Take the project number from the API-console dashboard (this is a 12-digit integer) and add it to airshipconfig.properties like so:
transport = gcm
gcmSender = [project-number]
Remove these lines from airshipconfig.properties:
transport = c2dm
c2dmSender = [our email]
Add a log line on receiving a notification with intent PushManager.ACTION_REGISTRATION_FINISHED that prints out: logger.w("Registration complete. APID: " + intent.getStringExtra(PushManager.EXTRA_APID) + ". Valid: " + intent.getBooleanExtra(PushManager.EXTRA_REGISTRATION_VALID, false));
The ACTION_REGISTRATION_FINISHED notification is coming back with what appears to be a valid APID. When I look it up in Urban Airship I can confirm that it's there:
APID
83014cb8-a573-45f9-9265-b95a8e21e7df
Alias
XDVRKQZ5WOGH
Active
True
Created
2 minutes ago
Tags
Phone, USA, PDT Group 7, PDT, HTC Glacier, App Version internal-4.4-b1, API 10, eng, receivesWeeklySpinTheWheelNotifications
C2DM Registration ID
None
But when I trigger a notification to this APID using the UA "Test Notification" console, the device never receives it (no log messages or user-visible notifications are generated indicating an incoming push) and no errors show up in the UA console. How can I debug from here?
EDIT: actually, some devices receive my test notifications (when I send them with that procedure), and some do not. I cannot discern any difference in the APID lookup. The devices which successfully receive are a phone running Android 2.3.3, a tablet running 3.1 and two phones running Android 4.1.1. The devices where it fails are a tablet running 4.0.3 and a phone running 2.3.4.