One device doesn't receive push notifications (GCM) - android

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?

Related

How I can avoid battery optimization of Samsung devices? (S6, S7 and S8)

I have a GPS tracking Android app that receives continuous push messages when someone requires user's position.
Everytime that I receive a push, I start the location service that send positions during X time while he is receiving push messages.
The problem started with android Doze system, that block http requests. I could receive messages but I never could send my current position (I received timeouts of http connections and error in pings to Google). But i could solve it with ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS request and adding the app into battery whitelist programatically.
Now, the app works fine in all devices except on Samsung devices over S6, that have "Smart manager" system. I tried to add manually the app into Samsung's battery whitelist (Setttings -> Device Maintenance -> Battery -> Unmonitored apps) but the problem persist.
If I keep the device with screen off and no charging, in a few time, it stops sending positions, but he still recieving push messages.
Can anyone help me with a magical solution? I saw a alleged "packages list" with a lot of apps that Samsung includes automatically into whitelist (Facebook, Whatsapp, Life360, for example) but I couldn't find what I need to do to add my app into this list automatically.
Based on the link provided by #ManmeetP, it looks like your only option is to use Samsung's "Knox" SDK: ApplicationPolicy.addPackageToBatteryOptimizationWhiteList()
https://seap.samsung.com/api-references/android-standard/reference/android/app/enterprise/ApplicationPolicy.html
This would mean bundling that SDK into your app for all your users =(

Push notification is not working in some Android devices

I developed an Android app for push notification. The targeted SDK is 23 and the minimum SDK is 11. I tested the app in Huawei P6 (4.2.2) and it runs smoothly, but I tested it with Huawei Y360 (4.4.2) and app does not work - push notification is neither sent or received.
This is my dependencies:
I carried out following actions:
Wifi connected
sim card, checked
push notification enabled.
API level fulfills the minimum required level.
But still does not work for the device. Is there any generous mind to help me with this? Spend almost two days, searched everywhere without vain and posted the question here.
Thanks
I faced problems like this sometimes (when push notification work on one device and doesn't work on other) and always the problem was in code.
1) If you are using gcm library try to check if your device register in gmc system, maybe problem is on this step.
2) I don't know how u testing push notifications (have u 2 physical devices or emulator), but u can try to clean project before build.
3) Also the problem can be on server side of ur app.

Synchronize notifications on multiple devices

I have an App which allows the user to send images to other users. It is available for Windows (x86), iOS (tablet and phone), Android (iPhone and iPad) and Windows Phone. Now, if a user is working on a Windows PC and his Smartphone is lying next to him, he gets a notification on both devices, this is could become very annoying.
Are there any known solutions how to "synchronize notifications" on multiple devices? (Only one notification is shown on the used device)
For example skype has solved this problem with his so called "active endpoints"-feature. Does anyone know how they could have implemented this?
Essentially, this feature is totally built-in to PubNub - indeed it's the raison d'etre of PubNub.
http://www.pubnub.com/blog/five-ways-you-can-use-pubnub-presence/
"Presence detects when users enter or leave your app, and gives the online/offline status of machines and devices connected to your app..."
Maybe you need to ask a more detailed question - "Can I do 'active endpoints feature' with PubNub?" - either here or on the PubNub forum.
Note that if you're using Parse, that is basically now back4app.com.

Does anyone know why some devices wouldn't receive push notifications?

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.

Android C2DM messages reach phone, forwarded to wrong app

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.

Categories

Resources