Push notification is not working in some Android devices - android

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.

Related

No FCM diagnostics when dialing *#*#426#*#*

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.

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 =(

Why some devices can receive notification from firebase, but another devices can't receive

I tried use three devices (two MI phone (one is Android 4.4.2,the other is Android 4.4.4)and one android emulator(Android 6.0)).
The problem is ,when i use firebase to send notification to device ,the Android 4.4.4 device always can receive the notification. But, the 4.4.2 device and the 6.0 emulator always can't receive it.
And i also tried use the token to sent notification to the designated equipment one by one. As a result, the 4.4.4 can receive ,but the 4.4.2 and the 6.0 can't receive the notification
All the test is under the some network and the some time
I had the same problem, I solve by uninstall the application completely the install as new and now working good

GCM notification not received on some Devices

Trying to send GCM notification to the devices asus,xiaomi redmi 1s but not getting the notification while the same notification is getting delivered to the other devices.As given in link
GCM notification not received on one of the mobile devices
these devices having security app such as AutoStart to disable app run in background on install.
So the question is how to notify user to enable app in autostart? Is there any programmatic way to deal with it because in our case if no GCM then there is no use of our app.
If you want any code then I can give it but as I stated above its(GCM) working on other devices and also work on above devices if app is enabled in Autostart,so I think there is no need to add code.
Thanks.
I have been dealing with the same issue from a long time. These devices specially redmi devices create a lot of problem . Redmi doesn't provide enough freedom to deal with notifications programatically. With every new install, you'll have to manually turn on autostart from 'Security' otherwise push notifications might have erratic behaviour. Further you'll have to add
GET_TASKS permission
in these devices which is deprecated

One device doesn't receive push notifications (GCM)

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?

Categories

Resources