In my app, in the Application class there is a function that triggers some network requests that fetch the needed data for the app to work. Recently i have noticed that these requests are trigger periodical every day at 11:00 GMT. From the logs i am getting it looks like it is not happening for every device using the app as the device ids i log every day are different. It looks like there is a library (there is nowhere in my code any periodical code that would trigger at that specific time per day causing it) that is causing it. In my app i use libs like Appsflyer, Google Play Services, Firebase, Crashlytics that could be triggering a sync job every day causing the issue though it is not possible to disable any of them in the production app. Unfortunately i am not able to repro the above problem on any of my devices so there is no way for me to debug it so far. Does any one has faced something similar or can give me any advice on how to move forward with this as these spike requests are causing issues and overload to our servers. Thanks in advance
Asked
Active
Viewed 284 times
1
-
Do you able to see the request destination with some sniffer like Charles: https://www.charlesproxy.com/? Do you know if these calls happen also when the app in in background? – Maxim Shoustin Sep 22 '20 at 18:39
-
I do know the destination but I don't know what makes the application class I create() to get triggered – makis.k Sep 22 '20 at 18:41
-
Well, if some job triggers the `create()` method where you initialize all above-mentioned frameworks, the outcoming traffic is a result of that. – Maxim Shoustin Sep 22 '20 at 18:45
-
That's what I cannot find, which job is causing that. Nothing on my code does so I guess it is a library – makis.k Sep 22 '20 at 18:46
-
Seems someone uses `ScheduledExecutorService` with `scheduleAtFixedRate`. If you able to reproduce it in debug mode, I suggest you to disable all SDKs and start to add them one by one. – Maxim Shoustin Sep 22 '20 at 18:56
1 Answers
1
It can be silent push notifications for uninstall measurement (AppsFlyer).
The Android Uninstall 'Silent' push notification is not always silent for the clients. This is a common issue and it can be a major pain for the clients.
Why does it happen?
The client can be overriding firebase's onMessageReceived(RemoteMessage remoteMessage)
method.Then they may have some of their own logic inside that method the is causing the push notification not to be silent.
Solution
The server side sends a 'silent' push with the payload {"af-uinstall-tracking":true}
. The client will need to add a extra few lines of code to handle this specific payload.
For example:
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
if(remoteMessage.getData().containsKey("af-uinstall-tracking")){
return;
} else {
// handleNotification(remoteMessage);
}
}
Be sure it is not your case

Maxim Shoustin
- 77,483
- 27
- 203
- 225