Proper way to detect TestFlight builds in iOS 18

I used to detect TestFlight builds prior to iOS 18 by the bundleReceiptURL like this.

The deprecation message points to AppTransaction instead of using receipts directly, but that does not help with my use case here.

What is the proper way to detect a TestFlight build now?

Proper way to detect TestFlight builds in iOS 18
 
 
Q