Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Senor Cuete

macrumors 6502
Original poster
Nov 9, 2011
424
30
I was going to upgrade my receipt validation code to the newer Store Kit API. Reading the documentation I see that the types and methods used are described but not the headers that have their definitions. What .h files should I #import so that for example, the compiler knows what an AppTransaction is? Also some of the code in the documentation is in Swift only. Are these APIs available only with Swift?

Adding StoreKit.framework in Link Binaries With Libraries doesn't help.

Linking against AppKit.framework doesn't help either.
 
Last edited:

Senor Cuete

macrumors 6502
Original poster
Nov 9, 2011
424
30
I guessed that linking against StoreKit.framework and #importing <StoreKit/StoreKit.h> would be the way to go. The project builds like this but the compiler thinks that AppTransaction, VerificationResult, etc. are undeclared identifiers.
 

mfram

Contributor
Jan 23, 2010
1,311
353
San Diego, CA USA
I would look at the header files themselves to see what they say. I don't see anything about an "AppTransaction" in those header files.
Code:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/StoreKit.framework/Versions/A/Headers
 

prime17569

macrumors regular
May 26, 2021
192
490
The new StoreKit 2 APIs are designed for use with Swift and it doesn't seem like they can be used with Objective-C.

Using StoreKit 2 is not possible with Objective-C or if you need to support versions before iOS 15.0.

 

Senor Cuete

macrumors 6502
Original poster
Nov 9, 2011
424
30
Apple also dropped support for SSL and deprecated ASN.1. This makes it much harder to implement receipt validation, which was extremely difficult anyway due to (deliberately) incomplete, documentation. Replacing the ASN.1 functions like SecAsn1Decode() won't be very hard, but this is a step toward the day when programming the Mac will be Swift only. You can also expect to see them deprecate things like .xib files. This is ********.
 

prime17569

macrumors regular
May 26, 2021
192
490
Apple also dropped support for SSL

They want you to use TLS 1.3 or newer now. TLS 1.2 is still supported, but it's not recommended. https://developer.apple.com/news/?id=bv8ur34d

and deprecated ASN.1.

They really want you to use the new StoreKit 2 API. See this thread: https://developer.apple.com/forums/thread/694197

Unfortunately, you will probably have to build some kind of shim that lets you communicate with StoreKit 2 from your objective-C code. Or rewrite your in-app purchase code in Swift.

You can also expect to see them deprecate things like .xib files.

Storyboards, nibs, xibs, and Interface Builder are already deprecated on visionOS. It's only a matter of time before this is the case on the other platforms.
 
Last edited:

Senor Cuete

macrumors 6502
Original poster
Nov 9, 2011
424
30
I'm responsible for a big program written in Objective C with .xibs. When this is deprecated I'll quit programming the Mac. You mention writing some sort of shim to communicate between Objective C code and Swift. How difficult is it to mix Objective C/C and Swift?
 

Senor Cuete

macrumors 6502
Original poster
Nov 9, 2011
424
30
Thanks for your help. I have a bunch of C code that performs complex mathematical calculations where high speed is required. I can't believe that Apple would deprecate the use of this in building applications.
 
  • Like
Reactions: prime17569
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.