zingle-dingle
zingle-dingle

Reputation: 1701

Can a app detect if it's installed as "External Testing" via TestFlight

I would like the Internal Testing and External Testing users on TestFlight to goto different API servers when they first run the app. I'm wondering if it's possible for the app to detect if it was installed as "Internal Testing" or "External Testing" app from TestFlight.

If this is not possible my next option was to build a separate app to send to Testflight that would use a different API server on startup. But this is more complicated.

The reason behind doing this is I only want external testers to see real data from the server. And not the bogus test data we have been submitting while developing the app.

Upvotes: 2

Views: 842

Answers (2)

José González
José González

Reputation: 1207

As far as I know it is not possible to detect internal vs external testers running your application.

But you don't have to build two different applications. I have similar requirements than you: I have a special menu in the application settings where internal testers may tweak several aspects of the application, like for example the server they are connecting to, so they can test the application without messing with production data, or buying content in a controlled environment. I don't want those settings to be available to external testers, so I do the following:

  • I create two different build configurations, one for internal testers (e.g. ReleaseInternal), and other for the rest (Release)
  • I define a preprocessor macro / Swift flag in the internal tester build configuration (e.g. INTERNAL_TESTING)
  • I use the preprocessor macro / Swift flag to activate / deactivate certain sections of code or functionalities
  • I create two different schemas, each one using the corresponding build configuration, so you just have to switch the schema to build the appropriate version of the application
  • And finally, I automate the release of the application using fastlane, with a flag indicating whether I want to release the application to internal or external testers, so I don't make a mistake and release the wrong version to the wrong people

Upvotes: 2

charmingToad
charmingToad

Reputation: 1597

It is not possible to detect whether an app was installed as "Internal Testing" or "External Testing".

Another solution is to make a build that points to real data by default, but has a hidden switch you can teach internal users to use to switch to test data.

You can use NSUserDefaults to save the switch setting so internal users don't have to switch it every time they install a new build or re-launch the app.

If you're worried about real users finding your secret switch, you'll have to make a separate app as you say.

Upvotes: 0

Related Questions