StoreKit 2 AppTransaction failing

We have had a small number of users of our mac app complaining that the app suddenly can't detect their subscription or previous purchase history. These users are not new, and have been using the app successfully for some time.

In the app we do this using the following (very standard) code at app startup:

let result: VerificationResult<AppTransaction> = try await AppTransaction.shared

For those users experiencing the failure, the result is coming back as unverified.

So far we've been unable to find the cause or a solution, but it seems to have become worse with the release of macOS 15.4. We've tried resetting, rebooting and reinstalling the app.

It's worth adding the (probably obvious) that it's impossible to test or fault-find with this, because we can't replicate the issue in a development environment.

Any suggestions gratefully received.

Our app is failing some of our long-term users because of this issue and we currently don't have anywhere to go, short of changing our sales model. The number of users contacting us with this problem is ramping up.

Any Apple Engineers around to offer any guidance? I will submit a bug report and instigate a DTS.

Quinn, I'm guessing you are familiar with issues surrounding AppTransaction. I've seen you offer guidance relating to receipts and transaction history in other posts. I'd really appreciate your view on this, even if it's just to acknowledge the issue or suggest an approach to debugging it. Or do I have "too much f***ing perspective"... :) Sorry. I know it was a joke on your part...

The same comments go to @endecotp and @Tlaloc

Thanks in advance.

FWIW our app has been in the store since 2009, so it contains a mixture of all the languages Apple has supported over the years.

The startup code is the old-fashioned main(), which then calls NSApplicationMain(). The bulk of the dispatching is written in Objective-C and Objective-C++. The grunt work is mostly done in C++, and the StoreKit integration is written in Swift5/SwiftUI.

The latest build of the app (the one that's failing) has a Deployment Target of macOS 14.2 and was built with Xcode 16.0

I've run into issues before with Objective-C / Swift integration, and I'm wondering if similar issues are in play here.

Update:

DTS Case-ID: 13195882

FB Assistant: FB17249398

It's hard to know exactly what happened to me. There was a valid receipt in my project that I was using for testing. This was loaded using the old API exit(173). After I upgraded to 15.4 It was either gone or invalid. In my post I added code toload a receipt if there isn't one. This posts a dialog asking me to enter my Sandbox user name and password and then gets a receipt. If you comment out the refresh() and run it again it will verify the receipt so I'm guessing that it is still in the build folder. I'm hoping that none of my users will report that they are getting this dialog.

What you have going on sounds much worse. If your users are getting their app from the store, the store either didn't attach a valid receipt or their older receipt is invalid on 15.4. I'm leaning to the second option. Would they have to get a valid receipt from the store? Download the app again from the store? How could they do this?

This sounds really bad.

@Tlaloc well, first of all, a huge thanks for actually responding at all. I can't get anything out of Apple.

I don't know what's going on with StoreKit 2, but testing it is not possible in development, it's so flakey (certainly on the mac, anyway).

Here's a post I did on Transactions on the Mac:

https://developer.apple.com/forums/thread/758315

It just doesn't work reliably.

I'm left thinking I'm going to have to use my live userbase for tests - i.e. try something in code and release it, then see if it works. I've been a developer for over 40 years and I've worked with a huge range of technologies, but I've never been in this position before.

I've been suggesting users download the app again from the store. I have a swathe of suggestions I've been offering, but nothing seems to work.

I've even bought our own app, and am running 15.4, but so far it works for me.

We also offer the app via our website, so I've been handing out free licenses to that version.

Your problem sounds bad, but at least there are things to try, even if they aren't ideal. I currently have no way forwards short of Apple fixing something, and that's not a position I want to be in.

Our first frustrated 1* review has just landed. Over the last few years we've had nearly all 5* reviews. I suspect it won't be the last.

But I'm not bitter... :)

Perhaps I'll just pack in being a developer and do something else.

StoreKit 2 AppTransaction failing
 
 
Q