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

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.

Related

Android check if device has notification access

So I am using the notifications access to know when certain apps are open and such, which works fine on Android O, but the problem I am having is that some devices apparently do not have access to this feature, so it displays this message.
This feature is not available on this device
Is there a way to know if the phone even has this feature available or not programmatically?
EDIT:
This is the code I currently use to send the user to the notification screen so they can enable access for my app, but as above, some devices like Moto E5 the phone itself does not allow this feature.
startActivity(new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS));

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

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?

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.

Android 4.4 SMS APIs - Unable to change default SMS app in tablets

I checked out the sample code for making your app the default sms client (found here), and the sample project works great on my Nexus 4 running 4.4. There is a button that when clicked, it does the following:
Intent intent = new Intent(Intents.ACTION_CHANGE_DEFAULT);
intent.putExtra(Intents.EXTRA_PACKAGE_NAME, context.getPackageName());
context.startActivity(intent);
and that makes the 'change sms app' dialog appear, that allows the user to switch their default sms application.
When I run the exact same project on my Nexus 7 (2012, Wifi), the button does nothing, although I can read in Logcat that the intent starts. The same thing happens with a Nexus 7 2013, wifi model I checked.
I tried downloading some sms app from the market and the exact same thing happens in all of them. They work great in my N4, no luck in my N7.
Anyone facing the same issue? Did they cut out the ability to write messages to devices that are unable to send texts as a whole?
Edit: Just noticed that the Telephony documentation writes:
Note: These APIs are not available on all Android-powered devices. If your app depends on telephony features such as for managing SMS messages, include a element in your manifest that declares the "android.hardware.telephony" hardware feature. Alternatively, you can check for telephony availability at runtime using either hasSystemFeature(PackageManager.FEATURE_TELEPHONY) or getPhoneType().
So, I'm guessing that if the device doesn't have the above feature it cannot 'manage SMS messages' (be the default SMS app).
It seems that sms no longer works on the Nexus 7 3G if you upgrade to Android 4.4.
In the past, some people have been able to use sms on their tablets by downloading and installing a third party sms app . Even though there is no stock messaging app with the ROM (and AFAIK, this is not an official feature), this has generally worked.
However, Android 4.4 KitKat on the Nexus 7 3G takes away this feature.
In Android 4.4, a messaging app must be set as the "default sms app" so it can be allowed to save new messages to the phone's message database. In other words, a messaging app must be the default sms app in order to operate fully.
In the Nexus 5 (and Android emulators), there is a setting Settings » ... » Wireless » Default sms app which allows you to choose your default sms app.
In the Nexus 7 3G, this setting DOES NOT EXIST.
It seems that the "default sms app" is not supported on the Nexus 7. In other words, you cannot set an app to be the default sms app. That means it is not possible to use an sms app.

Categories

Resources