diff --git a/!examples/InAppPurchaseManager/InAppPurchaseManager.xcodeproj/project.xcworkspace/xcuserdata/wangchujiang.xcuserdatad/UserInterfaceState.xcuserstate b/!examples/InAppPurchaseManager/InAppPurchaseManager.xcodeproj/project.xcworkspace/xcuserdata/wangchujiang.xcuserdatad/UserInterfaceState.xcuserstate index e56ed46..c3542e2 100644 Binary files a/!examples/InAppPurchaseManager/InAppPurchaseManager.xcodeproj/project.xcworkspace/xcuserdata/wangchujiang.xcuserdatad/UserInterfaceState.xcuserstate and b/!examples/InAppPurchaseManager/InAppPurchaseManager.xcodeproj/project.xcworkspace/xcuserdata/wangchujiang.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/!examples/InAppPurchaseManager/InAppPurchaseManager/SubscriptionView.swift b/!examples/InAppPurchaseManager/InAppPurchaseManager/SubscriptionView.swift index e218865..1dc68c2 100644 --- a/!examples/InAppPurchaseManager/InAppPurchaseManager/SubscriptionView.swift +++ b/!examples/InAppPurchaseManager/InAppPurchaseManager/SubscriptionView.swift @@ -15,47 +15,49 @@ struct SubscriptionView: View { let privacyPolicy = URL(string: "https://wangchujiang.com/copybook-generator/privacy-policy.html")! let termsOfService = URL(string: "https://wangchujiang.com/copybook-generator/terms-of-service.html")! var body: some View { - if !subscriptions.products.isEmpty { - VStack { - SubscriptionStoreView(productIDs: subscriptions.productIDs) - .storeButton(.visible, for: .policies) - .subscriptionStorePolicyDestination(url: privacyPolicy, for: .privacyPolicy) - .subscriptionStorePolicyDestination(url: termsOfService, for: .termsOfService) - .onInAppPurchaseCompletion(perform: { product, result in - if case .success(.success(let transaction)) = result { - print("Purchased successfully: \(transaction.signedDate)") - await subscriptions.updatePurchasedProducts() + NavigationStack { + if !subscriptions.products.isEmpty { + VStack { + SubscriptionStoreView(productIDs: subscriptions.productIDs) + .storeButton(.visible, for: .policies) + .subscriptionStorePolicyDestination(url: privacyPolicy, for: .privacyPolicy) + .subscriptionStorePolicyDestination(url: termsOfService, for: .termsOfService) + .onInAppPurchaseCompletion(perform: { product, result in + if case .success(.success(let transaction)) = result { + print("Purchased successfully: \(transaction.signedDate)") + await subscriptions.updatePurchasedProducts() + dismiss() + } else { + print("Something else happened") + } + }) + Button(action: { + Task { + await subscriptions.restorePurchases() dismiss() - } else { - print("Something else happened") } + }, label: { + Text("Restore Subscription") }) - Button(action: { - Task { - await subscriptions.restorePurchases() - dismiss() + #if os(macOS) + .buttonStyle(.link) + #endif + .offset(y: -22) + } + .background(.background) + .frame(minWidth: 320, minHeight: 580) + .frame(maxWidth: 450) + } else { + VStack { + if message.isEmpty { + ProgressView().progressViewStyle(.circular).scaleEffect(1).ignoresSafeArea(.all) + } else { + Text(message).foregroundStyle(.red) } - }, label: { - Text("Restore Subscription") - }) - #if os(macOS) - .buttonStyle(.link) - #endif - .offset(y: -22) - } - .background(.background) - .frame(minWidth: 320, minHeight: 580) - .frame(maxWidth: 450) - } else { - VStack { - if message.isEmpty { - ProgressView().progressViewStyle(.circular).scaleEffect(1).ignoresSafeArea(.all) - } else { - Text(message).foregroundStyle(.red) } + .padding(.horizontal) + .frame(minWidth: 230, minHeight: 120) } - .padding(.horizontal) - .frame(minWidth: 230, minHeight: 120) } } } diff --git a/README.md b/README.md index 0918ee8..a2a295f 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@
中文 • FAQ • - Contact & Support + Contact & Support • + Changelog
diff --git a/README.zh.md b/README.zh.md index 2042f06..edc6a21 100644 --- a/README.zh.md +++ b/README.zh.md @@ -7,7 +7,8 @@