Post

Replies

Boosts

Views

Activity

Reply to Mac OS 15.4 breaks receipt Validation
XCode error: Failed to parse AppTransaction: missingValue(for: [StoreKit.AppTransaction.Key.appTransactionID], expected: StoreKit.BackingValue)( In the Developer Documentation for AppTransactionID the definition includes: @backDeployed(before: iOS 18.4, macOS 15.4, tvOS 18.4, watchOS 11.4, visionOS 2.4)) So Apple DID change something in how it verifies receipts with OS 15.4. Is there any way to verify that my verification code will parse receipts on 15.4? Searching for @backDeployed in the documentation of course I can find nothing.
Topic: App & System Services SubTopic: StoreKit Tags:
Apr ’25
Reply to Mac OS 15.4 breaks receipt Validation
According to the Developer Documentation: "Important Calling refresh() displays a system prompt that asks users to authenticate with their App Store credentials. Call this function only in response to an explicit user action, like tapping or clicking a button." Calling let verificationResult = await AppTransaction.refresh isn't doing this or refreshing the AppTransaction.
Topic: App & System Services SubTopic: StoreKit Tags:
Apr ’25
Reply to Mac OS 15.4 breaks receipt Validation
I can get a receipt by putting code like this: let verificationResult = AppTransaction.refresh //do{}catch{} in the checkReceipt() function berore the do{}catch{} Then the program will run, verifying the refreshed receipt. This is OK for developing the application but you would want to delete this before building the app for submission to the App Store. Also it's possible that only doing this once during the development wouls leave a valid receipt in your build. I'll check this out.
Topic: App & System Services SubTopic: StoreKit Tags:
Apr ’25
Reply to Mac OS 15.4 breaks receipt Validation
Just to make sure that exit(173) is no longer working I added this code before I called my function verifyWithStoreKit(); void getReceiptData(void) { NSError *theError = nil; NSData *receiptData; NSURL *appStoreReceiptURL; NSBundle *mainBundle = [NSBundle mainBundle]; appStoreReceiptURL = [mainBundle appStoreReceiptURL]; if((receiptData = [NSData dataWithContentsOfURL: appStoreReceiptURL options: NSDataReadingMappedAlways error: &theError]) == nil) exit(173); } The first time you call exit(173), XCode will post an alert saying that exit(173) is no longer available but it actually WILL get a receipt. But then verification will fail to validate the receipt. This is happening with a built version of the app that worked fine for a long time as well because it had a receipt. This is worrying because this could happen to my users. Is there now no way to get a receipt to use while testing your application?
Topic: App & System Services SubTopic: StoreKit Tags:
Apr ’25
Reply to Xcode Archiving Mac app in "Other Items" section of Organizer
I solved the problem. I control-clicked on the archive in the organizer window to show it in the finder. It’s a .xarchive bundle. Control clicking on it shows a pop-up menu with the option to show the package contents. the package contains three things: a dSYMs folder, an Info.plist and a Products folder. The Products folder contains an Applications folder. This folder has a copy of the application and an app name.docarchive. Double clicking on the .docarchive opens the developer documentation with my application shown in the left side bar and a list of the Swift classes and functions that I implemented in my Objective-C application. So this looks like something that Xcode did when I added swift objects to the app with a bridging header. When there’s a .docarchive in the Application’s folder Xcode thinks it’s an type other. Setting the target build setting in Document Compiler - Options > Build Documentation During ‘Build’ to no fixes the problem.
Nov ’24
Reply to Application failed to be exported as an app
I solved the problem. I control-clicked on the archive in the organizer window to show it in the finder. It’s a .xarchive bundle. Control clicking on it shows a pop-up menu with the option to show the package contents. the package contains three things: a dSYMs folder, an Info.plist and a Products folder. The Products folder contains an Applications folder. This folder has a copy of the application and an appname.docarchive. Double clicking on the .docarchive opens the developer documentation with my application shown in the left side bar and a list of the Swift classes and functions that I implemented in my Objective-C application. So this looks like something that Xcode did when I added swift objects to the Objective-C app with a bridging header. When there’s a .docarchive in the Application folder Xcode thinks it’s an type other. Setting the target build setting in Document Compiler - Options > Build Documentation During ‘Build’ to NO- fixes the problem.
Nov ’24
Reply to Application failed to be exported as an app
Today I archived my project and exported it as an app, so I could use it on my machine. Then I set the appname>build to any Mac so I could upload it to the App Store. It started to archive it as other items. I literally didn't change anything except to build it for Intel and Apple silicon. I have been archiving the app for years with the same project settings - I didn't change anything. I have carefully studied your advice and the articles you cite about this and none of the suggestions on these have helped. This sure looks like an XCode bug to me.
Nov ’24
Reply to Xcode Archiving Mac app in "Other Items" section of Organizer
Today I archived my project and exported it as an app, so I could use it on my machine. Then I set the appname>build to any Mac so I could upload it to the App Store. It started to archive it as other items. I literally didn't change anything except to build in for Intel and Apple silicon. I have been archiving the app for years with the same project settings - I didn't change anything. I have carefully studied the threads about this and none of the suggestions on these have helped. This sure looks like an XCode bug to me.
Nov ’24
Reply to Un-Wanted Edit Menu Items
I solved the problem like this: In my AppController’s init method I added an observer to receive an NSApplicationWillFinishLaunchingNotification to remove the extra menu items. This won’t work. Xcode adds the extra items after this. You have to add a selector that will be notified by the NSApplicationDidFinishLaunchingNotification. NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver: self selector: @selector(handleAppLaunched:) name: @"NSApplicationDidFinishLaunchingNotification" object: nil]; The method to remove the extra menus looks like this: - (void) handleAppLaunched: (NSNotification *) note { NSMenu* edit = [[[[NSApplication sharedApplication] mainMenu] itemWithTitle: @"Edit"] submenu]; while( [[[edit itemAtIndex: [edit numberOfItems] - 1] title] compare: @"Paste" ] != 0) //-1 for zero indexing [edit removeItemAtIndex: [edit numberOfItems] -1]; //decrements the number of Items } The undocumented API for removing these with the user defaults is a cleaner way to do this. It’s pretty ridiculous that there are un-documented APIs and that there is no straight forward way to do this, like a build setting or object method, since this is something you would want to do for a lot of applications.
Nov ’24
Reply to AppTransaction: how to use in ObjC apps (now that we are forced to use it after the exit(173) deprecation)
I was working on this today and I encountered more strange problems: Even though the chekReceipt() Swift function returns a String (-> String), the MyAppTransaction class method in the automatically generated name-Swift.h file is defined as (void). This won’t work because if the verificationResult is either .unverified or there is an error I need to post an alert. You can only post an alert from the main thread. Calling one from the completion handler will cause a crash. I have to return a result to the main thread to create an alert. I tried to edit the name-Swift.h header to change the return type of the checkReceiptWithCompletionHandler method to string but I can’t, it’s apparently read only. Within the scope of the completion handler you can use the status string, for example NSLog(@"status: %@", status);, but you can’t return it to the calling function. I was hoping to copy it to the calling function with something like this: NSString* verifyWithStoreKit(void) { NSString* myString; [MyAppTransaction checkReceiptWithCompletionHandler: ^(NSString * _Nonnull status) { myString = [[NSString string] initWithString: status]; }]; //@autoreleasepool { // Setup code that might create autoreleased objects goes here. //} return myString; } But Xcode won’t build instructions like this or myString is nil. What can I do?
Nov ’24