How to install Application via Test Flight in IOS ?

I found something on how to install Application via Test Flight in IOS .

Here, appStoreReceiptURL is an instance property, which we can find from main bundle.

Screenshot 2019 03 26 at 3.12.47 PM

Here, I am adding snippet for both Objective-C and Swift.

Objective-C

- (BOOL)isTestFlight {
NSURL *appStoreReceiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
if (appStoreReceiptURL != NULL) {
return [appStoreReceiptURL.lastPathComponent isEqualToString:@"sandboxReceipt"];
}
return NO;
}
- (BOOL)isTestFlight {
NSURL *appStoreReceiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
if (appStoreReceiptURL != NULL) {
return [appStoreReceiptURL.lastPathComponent isEqualToString:@"sandboxReceipt"];
}
return NO;
}

Swift

func isTestFlight() -> Bool {
guard let appStoreReceiptURL = Bundle.main.appStoreReceiptURL else {
return false
}
return appStoreReceiptURL.lastPathComponent == "sandboxReceipt"
}
func isTestFlight() -> Bool {
guard let appStoreReceiptURL = Bundle.main.appStoreReceiptURL else {
return false
}
return appStoreReceiptURL.lastPathComponent == "sandboxReceipt"
}

Discover more from CODE t!ps

Subscribe now to keep reading and get access to the full archive.

Continue reading