How to tell at runtime whether an iOS app is running through a TestFlight Beta install

Hi,


Due to the fact that TestFlight version will stop working after 30 days (entitlements expiration) we want to inform the beta users with an alert inside the app.


I know that people recommended the next code:


NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
NSString *receiptURLString = [receiptURL path];
BOOL isRunningTestFlightBeta = ([receiptURLString rangeOfString:@"sandboxReceipt"].location != NSNotFound);


But when I try it on the simulator I get


/Library/Developer/CoreSimulator/Devices/817FCA39-2A4E-4E44-A1A7-56344A31C3A5/data/Containers/Data/Application/E8229057-06B8-4786-BD07-7AE1697E85DE/StoreKit/receipt


When all say I should receive sandboxReceipt.


Is there some kind of a solution I can trust?


Thanks.

Accepted Reply

Apple started alerting the users using an alert. It just says the app is expired or something like that but I guess its enough.

Replies

How often do your TestFlight testers run the app in the simulator?

TestFlight (more specifically provisioning) should alert them for you.

Apple started alerting the users using an alert. It just says the app is expired or something like that but I guess its enough.