Okay, I found a workaround for my app at least. Here's the situation:
Existing structure:
UIKit extension receives shared items and hands them off to a SwiftUI View
SwiftUI view eventually calls an @observable class for handling store actions like purchasing with StoreKit2
@observable class handles purchasing, and fires notifications for other parts of the app to process.
New structure:
unchanged UIKit extension receives shared items and hands them off to a SwiftUI View
SwiftUI uses the purchaseAction api with the environment @Environment(\.purchase) private var purchase: PurchaseAction setup to handle purchasing. The PurchaseResult is generated, and then passed off to the existing @observable class.
@observable class receives the PurchaseResult, and fires notifications for other parts of the app to process.
The above made it so that my app works re: in-app purchases via an extension again, and continues to work in the SwiftUI-only version of the app.
Topic:
App & System Services
SubTopic:
StoreKit
Tags: