No, endecotp, I can check what it's running on at run-time but that's not the problem. You can't build the project using AppTransaction unless you target at least 13.
Ah yes; sorry, I was forgetting the difference between the min-version and the max-version. I forget the exact terminology. You need to “target” ( if that’s the right term) a newer version that has the Swift AppTransaction support and set the oldest supported version to the older version without AppTransaction that you still want to support.
And there are some conversations about @available on these forums but not in the developer documentation.
LMGTFY: https://developer.apple.com/documentation/xcode/running-code-on-a-specific-version
Also if you target something like 10.15 you will get a whole bunch of compiler warnings about the security functions in your verification code being deprecated.
It is possible to silence specific warnings for specific files. Either do that, or just ignore them.
[MyAppTransaction checkReceiptWithCompletionHandler:^(NSString * _Nonnull status) { NSLog(@"status: %@", status); }];
Won't build - unknown object MyAppTransaction. Maybe some guidance about what to put in the bridging header would help?
YOU don‘t put anything in the bridging header - it gets created for you. It ought to have a readable objC declaration of MyAppTransaction; if it doesn’t, something has gone wrong, likely related to how you added that to the project etc. Having only done this once, last year I think, I have no idea of the exact steps needed.