Transaction.latest(for:) returns nil in StoreKit 2

Using the Implementing a Store In Your App Using the StoreKit API sample code, I've successfully integrated my new APP with StoreKit 2. There is one problem though: when I call the method Transaction.latest(for:) to get the user’s latest transaction, it always returns nil.

Here's the code snippet:

guard let result = await Transaction.latest(for: myProductId) else {
    return false
}

Is this a bug with StoreKit 2, or am I doing something wrong? This happens on a physical device, running from Xcode. Thanks in advance.

  • I have the same issue only on WatchOS though. Is yours the same?

  • Same here and only on watchOS

  • +1 with the same issue, only on WatchOS. On iOS it works correctly.

Add a Comment

Replies

It is hard to tell because the snippet is short, but as long as the myProductId parameter is correct, this is correct API use. We'd be happy to take a closer look if you post more code, or file a Feedback Report with code or a project.

If you think this represents a bug in StoreKit 2, please file a Feedback Report and include a sysdiagnose. Feel free to include any sample code or projects in the report.