The name-Swift.h header was filled in by XCode:
#ifndef Chac_Swift_h
#define Chac_Swift_h
#endif /* Chac_Swift_h */
The Swift object.swift file:
import StoreKit
@objc
class MyAppTransaction: NSObject {
@objc
class func checkReceipt() async -> String {
do {
let verificationResult = try await AppTransaction.shared
switch verificationResult {
case .unverified(_, _):
return "NG"
case .verified(_):
return "OK"
}
} catch {
return "ERR"
}
}
}
This will build if my target is at least 10.13 but there's no prototype in the name-Swift.h file. I thought that XCode was supposed to create this?
Calling [MyAppTransaction checkReceipt] from a .m file will result in an error - Class method +checkReceipt not found. Theoretically something in the -Swift.h file like:
@interface MyAppTransaction : NSObject
- (NSString*)checkReceipt;
@end
Should allow XCode to recognize the Class method, but what?
Topic:
App & System Services
SubTopic:
StoreKit