Post

Replies

Boosts

Views

Activity

Could not find intent for LiveActivity Button
I show some content in LiveActivity Dynamic Island and added a button. As buttons work with App Intent I created an Intent. When the button is clicked I get the following error Could not find an intent with identifier MyIntent, mangledTypeName: Optional("19LiveWidgetExtension10MyIntentV") MyIntent.swift import Foundation import AppIntents struct MyIntent: LiveActivityIntent { public init() { } func perform() async throws -> some IntentResult { print("click") return .result() } } MyLiveActivity.swift ... DynamicIslandExpandedRegion(.bottom) { HStack(alignment: .top) { Button(intent: MyIntent()) { Image(systemName: "bolt.fill") } } .tint(.white) .padding() } .... The Intent is added to all targets. Any ideas?
3
1
619
Feb ’24
StoreKit StoreView restore purchase listener
I use StoreKit's StoreView to buy in-app purchases. The purchase is working in the simulator, but how can I restore purchases? I did not find a restore handler, there is only a onInAppPurchaseCompletion but I'm missing a onRestorePurchaseCompletion or similar. This is how it looks This is my code: StoreView(ids: ["my.product.id"]) .storeButton(.visible, for: .restorePurchases) .storeButton(.hidden, for: .cancellation) .onInAppPurchaseCompletion { product, result in if case .success(.success(let transaction)) = result { print("Purchased successfully: \(transaction.signedDate)") isPremium = true } else { print("Something went wrong") } }
1
0
901
Mar ’24