Post

Replies

Boosts

Views

Activity

Transaction mismatch between subscription status api and App Store server Notifications
We are facing a issue of transaction mismatch between App Store server notification and subscription status api because of this we are not able to activate the expected subscription for user. User has successfully purchased a subscription from application. On our server we got the notification with below transaction : { **  "transactionId": "170001503839428",   "originalTransactionId": "170001503839428",**   "webOrderLineItemId": "170000681682289",   "bundleId": "com.*****",   "productId": "com.**.*",   "subscriptionGroupIdentifier": "21020104",   "purchaseDate": 1668398097000,   "originalPurchaseDate": 1668398098000,   "expiresDate": 1699934097000,   "quantity": 1,   "type": "Auto-Renewable Subscription",   "appAccountToken": "2d98c4f1-3af9-4965-89ca-0495940d1a58",   "inAppOwnershipType": "PURCHASED",   "signedDate": 1669031276395,   "environment": "Production" } We tried to validate the transaction using originalTransactionId (170001503839428) through subscription status api. We got below latest transaction from api having different originalTransactionId: {  ** "transactionId": "170001466326163",   "originalTransactionId": "170001466326163",**   "webOrderLineItemId": "170000661796452",   "bundleId": "com.*****",   "productId": "com.**.",   "subscriptionGroupIdentifier": "21020104",   "purchaseDate": 1665113844000,   "originalPurchaseDate": 1665113845000,   "expiresDate": 1665718644000,   "quantity": 1,   "type": "Auto-Renewable Subscription",   "inAppOwnershipType": "PURCHASED",   "signedDate": 1669036686044,   "offerType": 1,   "environment": "Production" } Because of this mismatch our validation is getting failed at our server. How is it possible to get different transaction when we are providing different originalTransactionId as api parameter? Dear team, please look into this.
1
0
833
Nov ’22
Background Assets: How do I set breakpoints in the extension for debugging?
I've added a background downloads extension to my app and added device console logging to every method in the placeholder code created by XCode, and Setting a breakpoint, then installed the app to the phone. When I run the following command: xcrun backgroundassets-debug --app-bundle-id com.myCompany.myApp --device-id 00008110-001E0DDA0AB8801E --simulate --app-update  prompt: Application was updated event was sent for app identifier: (com.myCompany.myApp). But the break point did not enter。Nothing is sent, and there is no log output How do I set breakpoints in the extension for debugging?
5
0
2.2k
Nov ’22
Live Activity Dark mode issue with `.activityBackgroundTint(_:)`
Hello, i am implementing Live Activity and facing a problem setting custom color for widget background. I have a dedicated catalogue of colors for WidgetExtension each having light/dark variant. The problem is, however, that widget's view changes color variants (any/dark) according to system settings, but not system background & text of widget set via .activityBackgroundTint(_:) and activitySystemActionForegroundColor(_:) Both widget background and system button texts remain in light variant no matter what system setting was when starting Live Activity. Later, i was able to kinda force LA background color by checking color scheme in my widget view (yellow and brown for test purposes) .activityBackgroundTint(colorScheme == .light ? Color.surface. : Color.brown) this would force Live Activity background to have expected color from start. BUT when i later change appearance in system settings Live Activity behaves weirdly, as if it was caching previous color I provided. I installed 16.2 beta in hope that it was fixed, but noticed this behaviour 👇 system in light mode: LA start, LA background is light set system to dark: LA background light set system to light: LA background dark ❗️ set system to dark: do not pull notification center, do not look at LA, instead immediately 👇 set system to light: LA background light Is there any way around this? 🙏
10
6
3.9k
Nov ’22
internal healthkit error: "Unable to invalidate interval: no data source avallable"
we are seeing what appears to be an internal healthkit error appearing in our app.  not sure if it's connected, but we've mostly seen it reported on devices running ios 16.  even though our app's primary language is japanese, and in all reported occurrences the app was running in japanese, the error message itself appears in english.  searching the error string on the web yields surprisingly few results (including only two mentions on this forum that i could find, neither of which seemed relevant).  this would seem to suggest that it's coming from something deep inside healthkit, since the error message is not localized.  in all reported cases, the user had recently upgraded to a new iphone.  in most cases, the problem only occurs on the new device even though everything had been working correctly prior to the upgrade.  the error occurs when the app is unable to read step count data from healthkit. we have confirmed that the app has been granted access permissions to all health data via os settings.  we've also tried having the user toggling those settings off, then back on, rebooting the device, deleting and reinstalling the app, etc., to no avail. the error message is "Unable to invalidate interval: no data source avallable." we'd appreciate it if anyone can shed more light on this issue. thanks!
4
3
1.3k
Nov ’22
iOS16.1 Connection Interval Changes?
Hello, When Apple officially released iOS16 to users in Sept and Oct this year, our custom device that uses a nRF52832 Nordic based BLE chip would no longer hold the connection for more that 90 seconds before disconnecting. Through other forums and documentation, we realized that with iOS16, Apple changed their requested Connection Intervals and we had to modify them on our product to solve. [Previously Worked with iOS15 & below] Connection Interval for Product: Min 7.5ms - Max 15ms Does not work with iOS16.0 Does work with iOS16.1 & iOS16.1.1 [Had to Change for iOS16.0, 16.0.1, 16.0.2, 16.0.3] Connection Interval for Product: Min 15ms - Max 30ms However, with the release of iOS16.1 in November, our original connection interval parameters work again. Does anyone know what Apple changed for iOS16.1 for the connection intervals? Why does iOS16.1 accept 7.5-15ms intervals when iOS16.0 doesn't? There are no changes to the connection interval requirements on the Apple Design Guidelines as of the last revision Oct26th,2022. Would really appreciate if anyone can share more info on the BLE change logs for iOS16.1. Thanks for the help!
1
0
1.6k
Nov ’22
Matter.framework does not work properly in iOS 16.1.1
On iOS 16.0, I added accessories via the MTRDeviceController class in the Matter.framework, and it worked fine. But when I will phone upgrade to the latest version of the iOS (iOS 16.1.1), after I call "MTRDeviceController" class "pairDevice: onboardingPayload: error:" method. I get an error like this: CHIP: [BLE] BLE:Error writing Characteristics in Chip service on the device: [The specified UUID is not allowed for this operation.] According to the error message, I guess that the characteristics of a certain Bluetooth cannot be read and written. After trying to verify it, I find that the characteristics uuid of the Matter accessory: "18EE2EF5-263D-4559-959F-4F9C429F9D12" cannot be read. So, my question is what can I do in iOS 16.1.1 to make my app work as well as it does on iOS 16.0.
10
0
3k
Dec ’22
how to sort the ip adresses returning from getaddrinfo() like /etc/gai.conf in linux
This is happening Mac M1 Monterey OS .Environment supports both IPv4 and IPV6. When a http client calls gettaddrinfo() it is returning both IPv6,IPv4 IPs . first v6 IPs and then v4 IPs. We need to have a way to sort gettaddrinfo() output to get v4 ip first and then v6. We tried changing DNS order with scutil by putting v4 DNS first , but still getaddrInfo() listing v6 IPs first . In linux there is a way to control gettaddrinfo() o/p with /etc/gai.conf https://man7.org/linux/man-pages/man5/gai.conf.5.html . In Mac I did not find any option like this , scutil changing order DNS is not effective . can you tell us what is way to do this in MAC OSx ?
6
0
2.1k
Dec ’22
Xcode Cloud macOS won't run test scheme - "Failed to load the test bundle"
I'm new to Xcode cloud - working with a Mac OS app, build is working great. Now I am trying to add a Test action; the testing target builds but won't run, and the error indicates it can't find the testing bundle in the expected build output. There's also mention of a code signing error, but I have automatic code signing enabled with the same settings on test target as the app. I am only running the unit test (XCTest) scheme, not the UI tests. When I run it locally from the IDE it works fine, either selecting the test scheme explicitly or as the test step of the app scheme. I notice the XCTest target's scheme setup uses Debug builds and expects the test output to be in the Debug .app bundle, I thought perhaps that was the problem (in case only the release app bundle actually gets built in the Xcode Cloud environment). So I created a duplicate scheme and set the build targets to Release - again I can run this fine locally (after creating a release build), but it fails with the same error in Xcode cloud. I also tried changing the code signing certificate from "Development" to "Sign to run locally" to see if that made a difference, but I get the same error. (It's using my developer account Team, and "Automatically manage signing".) Can anyone relate the proper way to set up an XCTest scheme so that the tests will actually run in a Mac OS Xcode Cloud workflow? I'm using Xcode 14.0.1. Here's the full error output, with [AppName] and [TestTargetName] substituted for the actual: [AppName] (....) encountered an error (Failed to load the test bundle. If you believe this error represents a bug, please attach the result bundle at /Volumes/workspace/resultbundle.xcresult. (Underlying Error: The bundle “[TestTargetName]” couldn’t be loaded. The bundle couldn’t be loaded. Try reinstalling the bundle. dlopen(/Volumes/workspace/TestProducts/Debug/[AppName].app/Contents/PlugIns/[TestTargetName].xctest/Contents/MacOS/[TestTargetName], 0x0109): tried: '/Volumes/workspace/TestProducts/Debug/[TestTargetName]' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/[TestTargetName]' (no such file), '/Volumes/workspace/TestProducts/Debug/[AppName].app/Contents/PlugIns/[TestTargetName].xctest/Contents/MacOS/[TestTargetName]' (code signature in <....> '/Volumes/workspace/TestProducts/Debug/[AppName].app/Contents/PlugIns/[TestTargetName].xctest/Contents/MacOS/[TestTargetName]' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)))) Thanks!
10
3
4.3k
Dec ’22
iOS Network Signal Strength
This issue has cropped up many times here on DevForums. Someone recently opened a DTS tech support incident about it, and I used that as an opportunity to post a definitive response here. If you have questions or comments about this, start a new thread and tag it with Network so that I see it. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com" iOS Network Signal Strength The iOS SDK has no general-purpose API that returns Wi-Fi or cellular signal strength in real time. Given that this has been the case for more than 10 years, it’s safe to assume that it’s not an accidental omission but a deliberate design choice. For information about the Wi-Fi APIs that are available on iOS, see TN3111 iOS Wi-Fi API overview. Network performance Most folks who ask about this are trying to use the signal strength to estimate network performance. This is a technique that I specifically recommend against. That’s because it produces both false positives and false negatives: The network signal might be weak and yet your app has excellent connectivity. For example, an iOS device on stage at WWDC might have terrible WWAN and Wi-Fi signal but that doesn’t matter because it’s connected to the Ethernet. The network signal might be strong and yet your app has very poor connectivity. For example, if you’re on a train, Wi-Fi signal might be strong in each carriage but the overall connection to the Internet is poor because it’s provided by a single over-stretched WWAN. The only good way to determine whether connectivity is good is to run a network request and see how it performs. If you’re issuing a lot of requests, use the performance of those requests to build a running estimate of how well the network is doing. Indeed, Apple practices what we preach here: This is exactly how HTTP Live Streaming works. Keep in mind that network performance can change from moment to moment. The user’s train might enter or leave a tunnel, the user might walk into a lift, and so on. If you build code to estimate the network performance, make sure it reacts to such changes. But what about this code I found on the ’net? Over the years various folks have used various unsupported techniques to get around this limitation. If you find code on the ’net that, say, uses KVC to read undocumented properties, or grovels through system logs, or walks the view hierarchy of the status bar, don’t use it. Such techniques are unsupported and, assuming they haven’t broken yet, are likely to break in the future. But what about Hotspot Helper? Hotspot Helper does have an API to read Wi-Fi signal strength, namely, the signalStrength property. However, this is not a general-purpose API. Like the rest of Hotspot Helper, this is tied to the specific use case for which it was designed. This value only updates in real time for networks that your hotspot helper is managing, as indicated by the isChosenHelper property. But what about MetricKit? MetricKit is so cool. Amongst other things, it supports the MXCellularConditionMetric payload, which holds a summary of the cellular conditions while your app was running. However, this is not a real-time signal strength value. But what if I’m working for a carrier? This post is about APIs in the iOS SDK. If you’re working for a carrier, discuss your requirements with your carrier’s contact at Apple.
0
0
2.6k
Dec ’22
Clearing activation lock returns 404 not found
The api url :https://deviceservices-external.apple.com/deviceservicesworkers/escrowKeyUnlock The document url: https://developer.apple.com/documentation/devicemanagement/device_assignment/activation_lock_a_device/creating_and_using_bypass_codes We use the api for past 1+ years, it works well. The api returns 404 not found response since 2022.12.02 <title>404 Not Found</title> </head> <body> <center> <h1>404 Not Found</h1> </center> <hr> <center>Apple</center> </body> </html> We contact apple support via email, but no useful response;
3
0
1.3k
Dec ’22
Hourly precipitation amounts seem drastically low
Hello. I took a closer look at the data I'm getting back for hourly forecasts and I'm baffled by results I'm seeing. For example, it's Dec 19, 2022 8:00am PT and I'm asking for the weather for Orchard Park NY (lat 42.766437 long -78.743855) for Dec 23, 2022. The daily forecast tells me they're expected to have 5.9" of snow. However, the hourly forecast with the most snow that day is reported as 0.071" (1.8mm). The Apple Weather app on iOS shows that hour as having 0.6". I wrote a 'for' loop to print the results of my call to WeatherService.shared.weather.         print(oneHour.precipitationAmount.formatted())         print(oneHour.precipitationAmount.description)         print(oneHour.precipitationAmount.unit)         print(oneHour.precipitationAmount.value) 0.071 in 1.8 mm <_NSStatic_NSUnitLength: 0x2010b0178> mm 1.8
7
0
2k
Dec ’22
Unfinished transactions not being emitted on start of app
I'm using the iOS simulator with a StoreKit configuration file. I can see that there have been transactions while the app has been closed, but my StoreKit 2 listener is never called with those updates to be able to finish them When I open my app from a cold start. I've added a listener on application(_:didFinishLaunching:launchOptions:) like this: func startObservingTransactions() { task = Task(priority: .background) { for await result in Transaction.updates { if case .verified(let transaction) = result { await transaction.finish() } } } } But the Transaction.updates loop never gets called (have added breakpoints to check). It's only ever called when a purchase is made, or subsequent transaction renewals when the app is open. Only then it will get the previously unfinished transactions. Steps to reproduce: Create an app with a StoreKit config file (with sped up transactions) to purchase an item Make a purchase then quit the app Wait for a bit for more transactions to be made while the app is closed. Open the app from a cold start and none of the transactions will be finished by the listener in your app. Cancel the subscription via the transaction manager. Close and open the app from a cold start. The first transaction will be finished by the listener but none of the others will be. In Apple's docs it says If your app has unfinished transactions, the listener receives them immediately after the app launches Why is this not the case?
14
2
4.4k
Dec ’22
Is there a way to override the theme of WidgetKit, so that we can retrieve correct named color in WidgetKit?
In main app, I can override dark/ light theme based on user preference, so that I can retrieve correct color information based on named color. if (user preference) { overrideUserInterfaceStyle = .light } else { overrideUserInterfaceStyle = .dark } // Dark theme/ light theme automatic aware color. SwiftUI.Color("purpleColor") However, how can I override the theme of a WidgetKit, so that my WidgetKit can interpret named color correctly? I know in WidgetKit, I can read what is current system wide theme settings using  @Environment(\.colorScheme) But, that is not what I want. I want the ability to override theme of a WidgetKit based on user preference, then able to retrieve correct named color. Thanks.
1
0
775
Dec ’22
Subscription is still waiting-for-review while app update is deplyoed
Hi. A couple of days ago I've released my new iOS app version update including subscription(in-app-purchase). App is successfully updated and deployed on store but App Store Connect says subscription is still waiting-for-review, and users cannot subscribe our paid features. (API says it's an error; invalid product id) On App Store Connect, it says "A subscription has been returned and is highlighted in the table below." in subscription section. But there's no clue what am I supposed to do next to fix this. I even have received the E-Mail says app update and subscription is successfully reviewed. I am so confused can anyone help me with this?
6
0
2.0k
Dec ’22
Can you preserve "early adopter pricing"?
Hi there, This may be a dumb question but I'm trying to confirm this before we go down this road. Essentially, we are looking to have one premium subscription available to users within our app. A yearly subscription and that's it. Since our app is brand new, we are looking to offer some "early adopter pricing" where early users can sign up for premium and lock in their yearly subscription at a fraction of what we will eventually charge. Will we be able to preserve pricing for select users while also making sure that new users aren't able to access that price? I was reading some articles and saw mention of "unpreserving users subscription pricing" so I figured there must be the functionality to preserve then? Thanks for the help!
2
0
1.1k
Dec ’22
Unable to load CloudKit CoreData Store
I have a CoreData model, in a Swift Package with tests. I can successfully run the tests, when I load the model using NSPersistentContainer, however attempting this with NSPersistentCloudKitContainer always fails in the call to loadPersistentStores(completionHandler block: @escaping (NSPersistentStoreDescription, Error?) -> Void) The error is : [CK] BUG IN CLIENT OF CLOUDKIT: Not entitled to listen to push notifications. Please add the 'aps-connection-initiate' entitlement. This issue is described on StackOverflow however, the accepted solution does not appear to work in my case. I have tried adding the aps-connection-initiate key to my App Info.plist, the Test Info.plist and the SPM bundle. No change. (NB. adding this to the entitlements file just breaks auto signing). I have enabled App entitlements for App Groups, Remote Notifications background mode, Push Notifications and iCloud CloudKit with a store identifier. I have checked my model. All relationships have inverses. No unique constraints, etc. etc. I am sharing a Bundle ID with a previous version of the App, that also uses CoreData+CloudKit, each version has it's own Model and container identifier, each container identifier is available in the provisioning profile. The new version of the model has two NSPersistentStoreDescriptions, one is configured for CloudKit, the other is a local cache. I am completely stuck, suggestions would be very welcome.
4
1
1.7k
Dec ’22
SimpleFirewall sample application not working
I can build the SimpleFirewall application (https://developer.apple.com/documentation/networkextension/filtering_network_traffic ) using xcode: After I run the application, seems can't block any traffic. I find there is some logs from network extension process: networkd_settings_read_from_file Sandbox is preventing this process from reading networkd settings file at "/Library/Preferences/com.apple.networkd.plist", please add an exception. Any step I am missing ?
3
0
587
Dec ’22
IntentDonationManager not donating Shortcuts
if #available(iOS 16.0, *) {       print("donated")       let intent = BasicIntent()       IntentDonationManager.shared.donate(intent: intent)    } Trying to test if donations work with the new App Intents framework. Donating the shortcut once a user taps a button. The shortcut is not appearing on the lock screen. Everything else is working as expected. The Shortcut is appearing in the Shortcuts App and is working via Siri. In developer settings I have Display Recent Shortcuts -> On Display Donations on Lock Screen -> On Allow Any domain -> On Allow Unverified sources -> On Running iOS 16.2, iPhone 11.
7
2
1.9k
Jan ’23