Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect if iOS App is Downloaded from Apple's Testflight [duplicate]

Tags:

In the past I've had separate build configurations for production and beta builds distributed through TestFlight. This made it easy to make modifications to beta builds, such as exposing additional settings the app to let testers test things more thoroughly and see more technical information about the status of the app.

Is there a way to check if an app has been distributed through Apple's TestFlight to make changes to how the app runs? Compiler directives no longer make sense as the same build can be distributed to beta testers and submitted to the store, but perhaps there's a way to check at runtime.

like image 882
Anthony Mattox Avatar asked Dec 04 '14 15:12

Anthony Mattox


People also ask

How do you know if an app is installed iOS?

In App store, click on the user icon top right of screen. Select "Purchased", then ensure that "All" is selected. Scroll down that list - Apps will either have an "Open" button (if they are installed), or a cloud download icon if they are int installed but eligible to be installed on that device.

Does Apple review TestFlight apps?

Before your external testers can test your app, you must submit your app to Apple for review like you would with a regular App Store submission. These reviews tend to be quicker than normal app reviews, but there's no guarantee. Once approved, you can send your app to external testers.

How do I check my TestFlight app?

Testing iMessage apps (iOS or iPadOS 10, or later) Install TestFlight on the iOS or iPadOS device that you'll use for testing. Open your email invitation or tap the public link on your iOS or iPadOS device. Tap View in TestFlight or Start Testing; or tap Install or Update for the app you want to test.

Is it safe to use TestFlight app?

Apple's TestFlight is a tool created to help developers distribute their beta apps to users before they are released on the App Store to everyone. However, scammers have been using the platform to distribute malicious apps without Apple's knowledge.


1 Answers

This works:

if ([[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]) {
    // TestFlight
} else {
    // App Store (and Apple reviewers too)
}

Update

The above method doesn't seem to work anymore, Apple changed the way they sign TestFlight builds. This does work however:

BOOL isRunningTestFlightBeta = [[[[NSBundle mainBundle] appStoreReceiptURL] lastPathComponent] isEqualToString:@"sandboxReceipt"];
like image 145
Kevin Renskers Avatar answered Sep 22 '22 12:09

Kevin Renskers