I'm using a solution based on this :
https://stackoverflow.com/questions/26081543/how-to-tell-at-runtime-whether-an-ios-app-is-running-through-a-testflight-beta-i%C2%A0TLDR, checking if Bundle.main.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt"
But this solution is returning true for isTestFlight even when I build the app in Debug.