Post

Replies

Boosts

Views

Activity

Reply to how to handle verification step for in-app purchase?
Looks like it is going to the pending case. But then you didn't anything else besides showing the message. You need to have a listener task to listen for Transaction.updates. for await result in Transaction.updates { // Verify the result, update your customer product status // finish the transaction } Also a task that checks Transaction.unfinished, there might be unfinished transactions.
Topic: App & System Services SubTopic: StoreKit Tags:
Jan ’26
Reply to In-App Purchases rejected + Reviewer cannot complete purchase
Create a Sandbox account in the Users & Access of App Store Connect. Select Sandbox, then create a Test Account. Use another email, enter the details accordingly. Then open the email, verify it. On your main device, Settings -> Your Name at the top, Media & Purchases -> Sign out. Go back to Settings, at the bottom Developer. Then scroll down to Sandbox Apple Account, sign in to the Sandbox test account. You can manage the In App Purchases settings there, like how long is one month. Back to your app that you are testing in TestFlight, test your purchase flow in there. Verify that it works, your subscription/IAP content can be displayed.
Dec ’25
Reply to Guideline 3.1.2 - Business - Payments - Subscriptions
For 3.1.2 Issue Description, you need to include a Terms of Use for apps with Auto Renewable Subscriptions. Either provide your own or you can use the standard Apple Terms of Use EULA. Make sure to put the http link in your description in App Store Connect. As for Resources, make sure your Store Sheet has the mentioned required fields. Also provide a Link in your App binary to the privacy policy and terms of use.
Nov ’25
Reply to Unable to download iOS 26.1 Simulator Runtime - Build 23B80 not available
I have the same issue on both my Macs, unable to download Build 23B86. Looks the build number has been bumped up. Update: For now the only way is to download from terminal using Xcode command line tools xcodebuild -downloadPlatform iOS -exportPath ~/Downloads Then install it using terminal, the guide is at: https://developer.apple.com/documentation/xcode/downloading-and-installing-additional-xcode-components#Download-Xcode-components-from-the-command-line
Nov ’25
Reply to How to use SwiftData with MVVM architecture?
Using @Query allows you to access the model class from your SwiftUI view, it allows you to specify sorting, filtering, etc, by using computed properties. In the ViewModel, you can define (assuming your model is called Todo): var todos: Todo If Todo has some properties like title, isCompleted, etc. declare variables in your view model as: var title: String { todo.title } var isCompleted: Bool { todo.isCompleted } Then you can do your logic in your SwiftUI view that has declared the view model to call viewModel.isCompleted. But if you modify the view model properties, they will not be persisted until you define it back, e.g.: // E.g. todo.isCompleted = true todo.title = viewModel.title try? context.save()
Jun ’25
Reply to Add App Group to Existing SwiftData App
You don't need to define that in your @Model class. Instead, in the main app, you have: let container: ModelContainer init() { let schema = Schema([YourModelName.self]) // Your model name inside let modelConfiguration = ModelConfiguration(schema: schema, allowsSave: true) do { container = try ModelContainer(for: schema, configurations: [modelConfiguration]) print("Model Container created successfully.") } catch { fatalError("Could not create Model Container: \(error.localizedDescription)") } } Then in your widget, in the timeline provider declare the variable for the model container: var container: ModelContainer = { try! ModelContainer(for: YourModelName.self) }() Then you need to just define your getEntries() function that returns an array of entries accordingly var descriptor = FetchDescriptor<YourModelName> let allEntries = try?container.mainContext.fetch(descriptor) return allEntries ?? [] // Empty array if it throws Don't forget to add the App Groups under the Signing & Capabilities tab for both the main app target and widget extension. Make sure it is the same one, e.g. group.com.yourcompany.YourAppName in both. Build it and make sure it is white and not in red for the App Groups.
Jun ’25
Reply to Live Activity fails to start with "unsupportedTarget" error on iOS 18 beta
Hi, the live activity function should look something like: func startLiveActivity() { let attributes = TimerAttributes(/*…*/) let contentState = TimerAttributes.ContentState(/*…*/) Task { @MainActor in do { let activity = try Activity<TimerAttributes>.request( attributes: attributes, content: ActivityContent(state: contentState, staleDate: staleDate), pushType: nil ) self.activity = activity } catch { print("Failed to start Live Activity: \(error)") } } } My TimerAttributes - this is your attributes for Live Activity, defined as: struct TimerAttributes: ActivityAttributes { public struct ContentState: Codable, Hashable { /* content state variables */ } /* other variables here */ } so when ever you call your start, you have to call your Live Activity start function. I place it in a Live Activity Manager.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’25
Reply to Using App Intents in Live Activity to Pause a Timer
The solution is found. To use buttons in LA or Dynamic Island, it shouldn’t be AppIntent, it should be LiveActivityIntent. struct PauseIntent: LiveActivityIntent { // followed by the rest of the code } either load the user defaults data that is linked with App Group or use SwiftData/CoreData, inject model container, and save the updated state there. Then update the live activity, the LA or Dynamic Island will show the updated ContentState. When returning to the app, reload the data from the data store and rebuild the necessary view models.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’25
Reply to how to handle verification step for in-app purchase?
Looks like it is going to the pending case. But then you didn't anything else besides showing the message. You need to have a listener task to listen for Transaction.updates. for await result in Transaction.updates { // Verify the result, update your customer product status // finish the transaction } Also a task that checks Transaction.unfinished, there might be unfinished transactions.
Topic: App & System Services SubTopic: StoreKit Tags:
Replies
Boosts
Views
Activity
Jan ’26
Reply to In-App Purchases rejected + Reviewer cannot complete purchase
Create a Sandbox account in the Users & Access of App Store Connect. Select Sandbox, then create a Test Account. Use another email, enter the details accordingly. Then open the email, verify it. On your main device, Settings -> Your Name at the top, Media & Purchases -> Sign out. Go back to Settings, at the bottom Developer. Then scroll down to Sandbox Apple Account, sign in to the Sandbox test account. You can manage the In App Purchases settings there, like how long is one month. Back to your app that you are testing in TestFlight, test your purchase flow in there. Verify that it works, your subscription/IAP content can be displayed.
Replies
Boosts
Views
Activity
Dec ’25
Reply to Guideline 3.1.2 - Business - Payments - Subscriptions
For 3.1.2 Issue Description, you need to include a Terms of Use for apps with Auto Renewable Subscriptions. Either provide your own or you can use the standard Apple Terms of Use EULA. Make sure to put the http link in your description in App Store Connect. As for Resources, make sure your Store Sheet has the mentioned required fields. Also provide a Link in your App binary to the privacy policy and terms of use.
Replies
Boosts
Views
Activity
Nov ’25
Reply to Unable to download iOS 26.1 Simulator Runtime - Build 23B80 not available
I have the same issue on both my Macs, unable to download Build 23B86. Looks the build number has been bumped up. Update: For now the only way is to download from terminal using Xcode command line tools xcodebuild -downloadPlatform iOS -exportPath ~/Downloads Then install it using terminal, the guide is at: https://developer.apple.com/documentation/xcode/downloading-and-installing-additional-xcode-components#Download-Xcode-components-from-the-command-line
Replies
Boosts
Views
Activity
Nov ’25
Reply to How to use SwiftData with MVVM architecture?
Using @Query allows you to access the model class from your SwiftUI view, it allows you to specify sorting, filtering, etc, by using computed properties. In the ViewModel, you can define (assuming your model is called Todo): var todos: Todo If Todo has some properties like title, isCompleted, etc. declare variables in your view model as: var title: String { todo.title } var isCompleted: Bool { todo.isCompleted } Then you can do your logic in your SwiftUI view that has declared the view model to call viewModel.isCompleted. But if you modify the view model properties, they will not be persisted until you define it back, e.g.: // E.g. todo.isCompleted = true todo.title = viewModel.title try? context.save()
Replies
Boosts
Views
Activity
Jun ’25
Reply to Add App Group to Existing SwiftData App
You don't need to define that in your @Model class. Instead, in the main app, you have: let container: ModelContainer init() { let schema = Schema([YourModelName.self]) // Your model name inside let modelConfiguration = ModelConfiguration(schema: schema, allowsSave: true) do { container = try ModelContainer(for: schema, configurations: [modelConfiguration]) print("Model Container created successfully.") } catch { fatalError("Could not create Model Container: \(error.localizedDescription)") } } Then in your widget, in the timeline provider declare the variable for the model container: var container: ModelContainer = { try! ModelContainer(for: YourModelName.self) }() Then you need to just define your getEntries() function that returns an array of entries accordingly var descriptor = FetchDescriptor<YourModelName> let allEntries = try?container.mainContext.fetch(descriptor) return allEntries ?? [] // Empty array if it throws Don't forget to add the App Groups under the Signing & Capabilities tab for both the main app target and widget extension. Make sure it is the same one, e.g. group.com.yourcompany.YourAppName in both. Build it and make sure it is white and not in red for the App Groups.
Replies
Boosts
Views
Activity
Jun ’25
Reply to Live Activity fails to start with "unsupportedTarget" error on iOS 18 beta
Hi, the live activity function should look something like: func startLiveActivity() { let attributes = TimerAttributes(/*…*/) let contentState = TimerAttributes.ContentState(/*…*/) Task { @MainActor in do { let activity = try Activity<TimerAttributes>.request( attributes: attributes, content: ActivityContent(state: contentState, staleDate: staleDate), pushType: nil ) self.activity = activity } catch { print("Failed to start Live Activity: \(error)") } } } My TimerAttributes - this is your attributes for Live Activity, defined as: struct TimerAttributes: ActivityAttributes { public struct ContentState: Codable, Hashable { /* content state variables */ } /* other variables here */ } so when ever you call your start, you have to call your Live Activity start function. I place it in a Live Activity Manager.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’25
Reply to Using App Intents in Live Activity to Pause a Timer
The solution is found. To use buttons in LA or Dynamic Island, it shouldn’t be AppIntent, it should be LiveActivityIntent. struct PauseIntent: LiveActivityIntent { // followed by the rest of the code } either load the user defaults data that is linked with App Group or use SwiftData/CoreData, inject model container, and save the updated state there. Then update the live activity, the LA or Dynamic Island will show the updated ContentState. When returning to the app, reload the data from the data store and rebuild the necessary view models.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’25