Reputation: 23
Our app satisfies the current exemptions on the restrictions on starting a foreground services on Android. We have all the necessary permission to allow it, AND our launch was triggered by a high priority FCM PUSH (which is one of the exemptions). Under testing, this exemption always works, but in the field, we see lots of Crashlytics data where it fails with the standard Security exception.
NOTE: Interestingly, the number of crashes spike right after a new release is issued. This makes me feel that the first time after a PlayStore upgrade, this exemption fails to work correctly. After about a week after a release, the occurrence rate of this exception settles down to almost nothing.
The Crashlytics breadcrumbs clearly show the FCM PUSH arriving and being High priority within milliseconds of attempting to start a foreground service. Logging all the permission (to Crashlytics breadcrumbs) indicated we have all that are necessary.
My worry is that the app may fail to respond to high priority PUSHs until the user launches the app? (I don't know this for sure, perhaps it's only the first launch after upgrading?)
[edit] This occurs on phones from at least 7 different manufacturers. 95% are running Android 14, the rest on 15. This makes sense because the stricter restrictions appeared in 14.
I know this is a pretty obscure combination of conditions, but wondering if anyone has seen anything like this or has ideas to track it down further.
If I could reproduce it, I might hope that Logcat shows a little more detail on the "why"
Chris
Upvotes: 0
Views: 65