Question

I'm trying to understand: On Android, How does TestFlight determine that it is in a beta-tester environment, and should upload activity to the TestFlight server? There have been some similar questions asking about TestFlight on iOS, but none related to Android.

I've integrated the TestFlight SDK into my company's Android app because it looked like a great solution for beta-testing and remote logging (we already use it for iOS), but I'm can't get it to actually send the session information to the TestFlight server. Once I install my app through the TestFlight app, I immediately see that it was installed through the TestFlight web console, and then... nada. I get no session data or remote logs, even though I clearly should be getting something.

What I have done so far:

  • Quadruple-checked my TestFlight api key
  • Verified for certain that TestFlight.takeOff() is getting called
  • Verified that TestFlight.isActive() reports true
  • Tried signing the apk with the debug-only key
  • Tried signing the apk with our release key
  • Checked the android log for errors related to TestFlight (none)
  • Contacted TestFlight support a couple days ago (I've made contact, but no progress yet)

My current guess is that the TestFlight lib thinks it is in a production environment, and therefore it should not be uploading logs and session information.

The SDK Documentation has nothing to offer to answer this question, but I feel that if I understood what conditions it is looking for I could nail this down pretty quickly.

I poked into TestFlightLib.jar and found that TestFlight.isActive() is really only reporting whether or not you've already called TestFlight.takeOff(), so that's not a good indicator of whether the whole system is working.

Was it helpful?

Solution

Edit: per Isra's answer below, it looks like my first point (batching checkpoints) may no longer be valid.

After trading a few emails with TestFlight support, I am seeing events and have a better understand of what is going on. There are two issues:

  1. TestFlight for Android batches checkpoint events and sends them to the server once 10 or more events are collected. Events are not preserved across app process lifetimes. My test app was only creating two or three checkpoints, thus nothing ever got sent to the server.

  2. There is an apparent issue where log events are not posted to the server at all unless the TestFlight session is explicitly ended with TestFlight.endSession()

So, the workaround (for now) is to explicitly call TestFlight.endSession() periodically. Hopefully TestFlight will change (or at least document) this behavior in future releases of the library.

OTHER TIPS

I am going to make a comment on the checkpoint front. I can see checkpoints being reported straight away without needing to end sessions. Looks like they removed the batching on Android

We made it work by calling TestFlight.startSession() on our activities onStart and TestFlight.endSession() on onStop.

The extra steps are not documented in TestFlight SDK, but it seems to force the app to send session logs to TestFlight servers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top