Post

Replies

Boosts

Views

Activity

Product.SubscriptionInfo.Status is empty despite having valid subscription.
I don't know if this is a iOS 18.1 beta bug or some StoreKit server issues but Product.SubscriptionInfo.Status is returning an empty array in production even if the user has a valid subscription that is months away from expiring or renewing. I myself ran into this issue this morning but of course everything is fine in development mode so that makes it quite challenging to debug. Anyone else has this issue?
2
0
341
Sep ’24
Swift compiler crash with Xcode 16 beta 5
This simple project just makes the Swift compiler crash in init(comparator: KeyPathComparator<RemoteComputer>): import SwiftUI struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") } .padding() } } enum CSItemOrderType: Int, Codable, CaseIterable, CustomStringConvertible { case readableName case lastConnectionDate case numberOfConnections var description: String { switch self { case .readableName: return "STR_NAME" case .lastConnectionDate: return "STR_LAST_CONN_DATE" case .numberOfConnections: return "STR_ORDER_MOST_CONNECTED" } } } struct CSItemOrder: Codable { static let allCases = [CSItemOrder(type: .readableName), CSItemOrder(type: .lastConnectionDate, order: .reverse), CSItemOrder(type: .numberOfConnections, order: .reverse)] static let allSortOrders = [KeyPathComparator(\RemoteComputer.readableName), KeyPathComparator(\RemoteComputer.lastConnectionDate), KeyPathComparator(\RemoteComputer.numberOfConnections)] let type: CSItemOrderType var order: SortOrder var comparator: KeyPathComparator<RemoteComputer> { switch type { case .readableName: return KeyPathComparator(\RemoteComputer.readableName, order: order) case .lastConnectionDate: return KeyPathComparator(\RemoteComputer.lastConnectionDate, order: order) case .numberOfConnections: return KeyPathComparator(\RemoteComputer.numberOfConnections, order: order) } } init(type: CSItemOrderType, order: SortOrder = .forward) { self.type = type self.order = order } init(comparator: KeyPathComparator<RemoteComputer>) throws { switch comparator.keyPath { case \RemoteComputer.readableName: self.init(type: .readableName, order: comparator.order) case \RemoteComputer.lastConnectionDate: self.init(type: .lastConnectionDate, order: comparator.order) case \RemoteComputer.numberOfConnections: self.init(type: .numberOfConnections, order: comparator.order) default: print("Unsupported keyPath: \(comparator.keyPath)") throw ItemOrderError.unsupportedKeyPath } } } struct RemoteComputer: Codable, Hashable, Identifiable { let id: Int let name: String let hostname: String? let localIpAddress: String? let vncPort: Int let sshPort: Int let publicIpAddress: String? let publicPort: Int let macAddress: String let scVersion: String let manualMode: Int let uuid: String let lastMappingStatus: String? let isAwake: Bool let unregistered: Bool let osVersion: String? let lastUpdate: Date let remoteAddress: String? let lastKeyboardLocale: String? let macSystemShortcuts: [String: [Int32]]? var readableName: String { return name.removingPercentEncoding ?? name } var lastConnectionDate: Date { return Date.now } var unwrappedPublicIpAddress: String { return publicIpAddress ?? NSLocalizedString("STR_NOT_AVAILABLE", comment: "") } var numberOfConnections: Int { return 0 } } enum ItemOrderError: Error { case unsupportedKeyPath } This code works fine in previous betas or Xcode 15.
4
1
517
Aug ’24
Search Ads (Basic) campaign stopped at previous budget even if it was raised during the month.
I raised the monthly budget for this app from $1300 to $2000 during July, but the campaign stopped once it reached $1303.84 around July 21st. I understand that lowering the budget should only apply in the following month, so why did the campaign stop even though there was roughly $700 left for the month? The issue is that the system spent the initial budget within three weeks as if it was using the new budget, so I don't have ads showing for the remainder of the month. The CPI is set at $5.60 per recommendation, and the average CPI is $1.28, so I don't think the issue is that the bid is not high enough.
1
0
326
Jul ’24
onKeyPress not working on iOS/iPadOS 17.4 but fine on macOS
According to a post on hackingwithswift.com, this should work on iOS/iPadOS: import SwiftUI struct ContentView: View { @FocusState private var focused: Bool @State private var key = "" var body: some View { Text(key) .focusable() .focused($focused) .onKeyPress { press in key += press.characters return .handled } .onAppear { focused = true } } } It does not work for me using a hardware keyboard on an iPad running the latest iPadOS 17.4 beta but it does work on my Mac. FB13644182
1
0
568
Feb ’24
Keyboard will not show when setting focus on a SwiftUI text field from a button in an ornament on visionOS
Using a button that is placed in the bottom ornament to set focus on a text field will not display the keyboard properly while a button embedded in the view will behave as expected. To demonstrate the issue, simply run the attached project on Vision Pro with visionOS 1.1 and tap the Toggle 2 button in the bottom ornament. You’ll see that the field does have focus but the keyboard is now visible. Run the same test with Toggle 1 and the field will get focus and the keyboard will show as expected. import SwiftUI import RealityKit import RealityKitContent struct ContentView: View { @State private var text = "" @State private var showKeyboard = false @FocusState private var focusedField: FocusField? private enum FocusField: Hashable { case username case password } var body: some View { VStack { TextField("Test", text: $text) .focused($focusedField, equals: .username) Text("Entered Text: \(text)") .padding() Button("Toggle 1") { // This button will work and show the keyboard if focusedField != nil { focusedField = nil } else { focusedField = .username } } Spacer() } .padding() .toolbar { ToolbarItem(placement: .bottomOrnament) { Button("Toggle 2") { // This button will set focus properly but not show the keyboard if focusedField != nil { focusedField = nil } else { focusedField = .username } } } } } } Is there a way to work around this? FB13641609
0
0
487
Feb ’24
Toolbar buttons disappearing when showing a navigation split view as a sheet
When displaying a view using a navigation Split View as a sheet, the toolbar button will disappear if you leave the app and resume it. import SwiftUI struct Folder: Hashable, Identifiable { let id = UUID() let name: String } struct ContentView: View { @State private var showingSettings = false var body: some View { VStack { Button { showingSettings.toggle() } label: { Text("Settings") } } .sheet(isPresented: $showingSettings, content: { SettingsView() }) .padding() } } struct SettingsView: View { @Environment(\.dismiss) private var dismiss @State private var selectedFolder: Folder? = nil private var folders = [Folder(name: "Recents"), Folder(name: "Deleted"), Folder(name: "Custom")] var body: some View { NavigationSplitView { SidebarView(selectedFolder: $selectedFolder, folders: folders) } detail: { VStack { if let folder = selectedFolder { Text(folder.name) } else { Text("No selection") } } .toolbar { ToolbarItem(placement: .cancellationAction) { Button { dismiss() } label: { Text("Cancel") } } ToolbarItem(placement: .confirmationAction) { Button { dismiss() } label: { Text("Save") } } } } } } struct SidebarView: View { @Binding var selectedFolder: Folder? var folders: [Folder] var body: some View { List(selection: $selectedFolder) { ForEach(folders) { folder in NavigationLink(value: folder) { Text(folder.name) } } } } } Steps to reproduce the issue: Launch the attached project on an iPad or iPad simulator Tap the Settings button Select one item in the sidebar Use the app switcher to open an other app or just leave the app Bring back the app Result: Both Cancel and Save buttons are gone. Note: This will not occur if no item is selected in the sidebar. FB12991687
4
0
1.2k
Jan ’24
NSCocoaErrorDomain 4097: connection to service named com.apple.storekitagent
We had a few users reporting this issue where our app is unable to connect to StoreKit. Failed product request from the App Store server: systemError(Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.storekitagent" UserInfo={NSDebugDescription=connection to service named com.apple.storekitagent}) This occurs when calling Product.products(for:). Some users mentioned they had to restart their Mac in safe mode to make the error go away, some had DNS cache issues and clearing those helped, or some found the culprit to be Adguard. What could be causing this error as it is not very clear what's causing it?
4
0
1.9k
Dec ’23
Transaction.currentEntitlements never returns if there are no entitlements?
I'm uncertain about the reason behind Transaction.currentEntitlements not returning nil when there are no current entitlements. The challenge I'm facing is that, in the scenario where a trial period concludes, Transaction.currentEntitlements seems to perpetually withhold any response, leaving me without a means to discern the conclusion of the trial. I'm puzzled as to why this method doesn't simply return nil when no entitlements are detected. It would be immensely helpful if someone could shed light on the rationale behind this behavior or point out any potential errors in my understanding. Your insights would be greatly appreciated. Thanks.
0
0
535
Dec ’23
IAP rejected (Guideline 2.1) while binary waiting for review?
That's a new one for me. I have submitted 2 IAP along with an update for my app. The Mac binary was approved but then one of the IAP was rejected with this message: "We have returned your IAP product/s to you as the required binary was not submitted. When you are ready to submit the binary, please resubmit the IAPs with the binary." I'm not sure what this means as the related binary is actually waiting for review. What does this error means and how can I fix it?
0
0
472
Dec ’23
Cannot redeem offer codes on Mac App Store, works fine on App Store.
It appears there's an issue with the Mac App Store's ability to process offer codes, unlike its iOS counterpart, which handles them seamlessly. Users attempting to redeem a code on their Mac are encountering a "Cannot redeem code. Try another code" error. Considering the Mac App Store's long history, having been introduced nearly 13 years ago, it's high time for it to align with the iOS App Store's functionality. While it's close to 80% there, addressing these lingering issues would greatly improve the user experience. FB13463658
1
1
816
Dec ’23