I have recently been working with C2DM on a Samsung Galaxy Tab 10.1" running stock Honeycomb. I finally got the device registering and my server sending out push messages, however, when I tried to run the exact same code on a Motorola Xoom (running Stock Honeycomb), two Sony tablets (running Stock Honeycomb), and a phone (running CM7.1) none of them worked.
I got fresh registration IDs for each of the devices and tried again and again, but always only the Samsung works.
I have a print statement in the onRecieve() of my BroadcastReceiver class and this gets printed every single time for registration of each device. It only ever gets printed again (when I send a push message) on the Samsung tablet. Does anyone know why this might happen?
I would post some code, but I honestly don't know which part of my code to post. I cen't even figure out if it's server side or client side. I did, however, try to follow the Google Doc as much as possible.
Make sure each device is properly registered and that you pass in the proper device id when you send the POST request to google. Also, the devices need to have a Google account logged in. Check all the requirements here: http://code.google.com/android/c2dm/
Also, if the device is already registered, don't register it again. Once it's registered, confirm it in onReceive and if it is, then try sending an actual push with a payload.
Related
I'm currently debugging issues where FCM push messages are sporadically not delivered to my Android app.
The principal setup and configuration works, most (high prio) push messages are delivered in a timely manner - but sometimes they are not.
When perusing the official troubleshoot guide (https://firebase.google.com/support/troubleshooter/fcm/delivery/diagnose/android), it advises me to dial *#*#426#*#* to get some diagnostics.
I've tried this now on three phones (Samsung Galaxy S7, Samsung XCover 4S, Motorola Moto X) but nothing happens - the phone just tries to do the call.
I've assumed that "dial this code" means "Open up the dialer app, enter this code, pick up". Was that incorrect?
Ok, found it.
This only works with Android's default dialer app or the Phone by Google app that can be loaded from the Play Store.
The custom dialers included by some handset makers (glaring at you Samsung) can't do it.
So, to get the diagnostics: Make sure to use the right dialer.
FCM was sending notification to a random device every time with even though it was the same token, so it should have sent it to the same device every time.
FCM was working fine with one device, but when I added another device (with emulating it with Android studio) I started seeing that the notification would go to the unintended device at times, and I would always see that one of the tokens would get un-registered, and when I use one token the notification would arrive at any of the 2 devices. so my question is how to have 2 unique tokens where I can communicate and send my token to the device I select ?
I suspect that what is happening is that I can only get one Token and my 2 devices are actually sharing it, but I could be wrong.
Apparently it is not a bug, when I used a different computer I was able to get the right notification recipient every time, this tells me that it has to do with the fact that the first time the bug happened when I was using 2 devices from emulated from the same computer, but didn't happen when I used 2 separate computers to generate my notifications
I am following androidhive's tutorial. I am having weird problem if I try sending notification from console everything is fine. But if I try sending notification from web app devices below lollipop is not receiving any notification. What might be the possible problem
This is first time I hearing this type of issue and have you tested with other device other than your development devices. If a device is registered with the gms then it should receive the message. Try to clear the cache data of your app might be helpful.
I have old Motorolla Droid Razor (Android 4.0.4) which doesn't receive push notifications.
I had a problem receive push notifications on it from my app. Initially I thought that I am doing something wrong (there are a lot of small things which break it).
I got GcmClient (Google's sample app - https://code.google.com/p/gcm/) built it and tried it. It works fine on other phones, but doesn't work on this one.
On this phone tt can:
a) Find Google Play Services
b) It can register and get regid.
c) It can send an echo message and it comes back
However, it never receives messages from the server.
I use the same WiFi for several phones. This rules out issues with firewall.
I tried to hard reset the phone (to make sure that I am getting the latest Google Play Services).
Any ideas? Has anybody seen issue like that?
I've been messing around with C2DM and have a nice little app working perfectly in the Emulator. I send a message from my app server to Google's C2DM servers, the message will arrive on the emulator and my app would respond appropriately.
My problem now is running the app on my smartphone (a Nexus One). The app runs fine and registers for C2DM with Google and then forwards it's rego ID to my application server. This is all working as expected. Problem is, when I send a message from my app server to the phone, my app never receives the message. After some investigation I found out
that the message reaches the phone, but the C2DM subsystem seems to be forwarding the message to the Google Talk app and not MY app.
Has anyone seen this behavior before? Can anyone give hints on what to look for to solve this? I was assuming that if the registration messages where forwarded to my app, then everything else should be as well.
Thanks,
Jamie
It now 'just works'. For some reason after today's testing everything is just working. The only differences are an update to Froyo that came down OTA a few weeks back but other than that the app is it's original version.