czottmann,
@czottmann@norden.social avatar

#Xcode frens, how do you implement "TestFlight or App Store" switches in your apps? Are you working with different builds, or do you use runtime environment checks?

I've been using Bundle.main.appStoreReceiptURL?.path but that doesn't work anymore on macOS. (Tested w/ Xcode 14.3.1 on Ventura)

/㏄ @swift @swiftui

czottmann,
@czottmann@norden.social avatar

Status update: After hours of further testing and prodding, @siracusa sent me this gist (thanks again, John!):

> A code snippet for detecting the #TestFlight environment for a #macOS app at runtime
https://gist.github.com/lukaskubanek/cbfcab29c0c93e0e9e0a16ab09586996

Looks promising!

#Xcode #swift

esnahel,

@czottmann @siracusa is there something like this for iOS?

czottmann,
@czottmann@norden.social avatar

@esnahel @siracusa There is.

let isTestFlight = Bundle.main.appStoreReceiptURL?.lastPathComponent == "sandboxReceipt”

HTH!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • swiftui@a.gup.pe
  • DreamBathrooms
  • everett
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • rosin
  • cubers
  • Durango
  • Youngstown
  • slotface
  • khanakhh
  • kavyap
  • ngwrru68w68
  • GTA5RPClips
  • JUstTest
  • osvaldo12
  • tacticalgear
  • modclub
  • cisconetworking
  • mdbf
  • tester
  • ethstaker
  • Leos
  • normalnudes
  • provamag3
  • anitta
  • megavids
  • lostlight
  • All magazines