I found little snippet from twitter about how to know if application is installed via TestFlight.
Here, appStoreReceiptURL
is an instance property, which we can find from main bundle.
Here, I am adding snippet for both Objective-C and Swift.
Objective-C
1 2 3 4 5 6 7 |
- (BOOL)isTestFlight { NSURL *appStoreReceiptURL = [[NSBundle mainBundle] appStoreReceiptURL]; if (appStoreReceiptURL != NULL) { return [appStoreReceiptURL.lastPathComponent isEqualToString:@"sandboxReceipt"]; } return NO; } |
Swift
1 2 3 4 5 6 |
func isTestFlight() -> Bool { guard let appStoreReceiptURL = Bundle.main.appStoreReceiptURL else { return false } return appStoreReceiptURL.lastPathComponent == "sandboxReceipt" } |
Happy Coding 🙂