Posts

Sort by:
Post not yet marked as solved
0 Replies
24 Views
For important background information, read Extra-ordinary Networking before reading this. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com" Network Interface Statistics One FAQ when it comes to network interfaces is “How do I get network interface statistics?” There are numerous variants of this: Some folks ask about specific network interfaces: “How do I get cellular data usage?” Some folks are interested in per-app statistics: “How do I get cellular data usage statistics for each app?” or “How do I get cellular data usage statistics for my app?” Some folks only care about recent statistics: “How can I tell how much network data this operation generated?” Some folks care about usage across restarts: “How do I get the cellular data usage shown in the Settings app on iOS?” Most of these questions have no supported answers. However, there are a some supported techniques available. This post explains those techniques, and their limitations. MetricKit To get network usage for your app, use MetricKit. Specifically, look at the MXNetworkTransferMetric payload. MetricKit has a number of design points: You only get metrics for your app. You get metrics periodically; you can’t monitor these statistics in real time. Legacy Techniques The getifaddrs routine returns rudimentary network interface statistics. See the getifaddrs man page and the struct if_data definition in <net/if_var.h>. Here’s an example of how you might use this: func legacyNetworkInterfaceStatisticsForInterfaceNamed(_ name: String) -> LegacyNetworkInterfaceStatistics? { var addrList: UnsafeMutablePointer<ifaddrs>? = nil let err = getifaddrs(&addrList) // In theory we could check `errno` here but, honestly, what are gonna // do with that info? guard err >= 0, let first = addrList else { return nil } defer { freeifaddrs(addrList) } return sequence(first: first, next: { $0.pointee.ifa_next }) .compactMap { addr in guard let nameC = addr.pointee.ifa_name, name == String(cString: nameC), let sa = addr.pointee.ifa_addr, sa.pointee.sa_family == AF_LINK, let data = addr.pointee.ifa_data else { return nil } return LegacyNetworkInterfaceStatistics(if_data: data.assumingMemoryBound(to: if_data.self).pointee) } .first } struct LegacyNetworkInterfaceStatistics { var packetsIn: UInt32 // ifi_ipackets var packetsOut: UInt32 // ifi_opackets var bytesIn: UInt32 // ifi_ibytes var bytesOut: UInt32 // ifi_obytes } extension LegacyNetworkInterfaceStatistics { init(if_data ifData: if_data) { self.packetsIn = ifData.ifi_ipackets self.packetsOut = ifData.ifi_opackets self.bytesIn = ifData.ifi_ibytes self.bytesOut = ifData.ifi_obytes } } This is a legacy interface. macOS inherited this API from its ancestor platforms, and iOS inherited it from macOS. That history means that the API has significant limitations: The counters reset each time the device restarts. The counters are represented as a UInt32, and so wrap at 4 GiB [1]. Due to its legacy nature, there’s little point filing an enhancement request against this API. [1] The <net/if_var.h> header defines an if_data64 structure, but there’s no supported way to get that value on Apple platforms. Limitations When it comes to network interface statistics, certain tasks have no supported solutions: Getting per-app statistics Getting whole device statistics that persist across a restart Getting real-time statistics for your app that persist across a restart If you need one of these features, feel free to file an enhancement request for it. In your ER: Be specific about the platforms you need this on [1]. Make sure that your request is aligned with that platforms privacy constraints. For example, iOS isolates your app from other apps, so you’re unlikely to get an API that returns per-app statistics for all apps on the system. Supply a clear justification for why this is important to your product. [1] If it’s macOS, be clear about: Whether your app is sandboxed or not. Whether it’s a Mac Catalyst. Or running via iOS Apps on Mac.
Posted
by
Post not yet marked as solved
0 Replies
16 Views
To authenticate Apple Pay payment through Mobile Test Automation via Face ID and a side button click if there is a way to automate a process involving Apple Pay where authentication could be performed using a software-based solution accessible through automation. Is there any way to access the side click button programmatically, using XCTest?
Posted
by
Post not yet marked as solved
0 Replies
35 Views
■Confirmation (2 points) ① Question about setting Constraints for UIScrollView. Is it correct to align the display position of the top edge of ContentsView, which contains the actual displayed content, with "ContentLayoutGuide" instead of "FrameLayoutGuide"? ② Is there a difference in screen display control between Xcode 14.1 and earlier and Xcode 15.0 when multiple Constraints are set for the same screen component? ■Background of the question On the screen that implements UIScrollView, the following two constraints regarding the display position of the top edge of ContentsView were set. Match the top of "FrameLayoutGuide". Match the top of "ContentLayoutGuide". Also, the priorities of the above two Constraints were the same. In Xcode 14.1, I was able to scroll the screen without any problems. When I upgraded to Xcode 15.0, the following error message appeared and I was unable to scroll. Unable to simultaneously satisfy constraints.
Posted
by
Post not yet marked as solved
1 Replies
27 Views
Team, When I try using Apple pay for Japan, we are getting Payment Not Completed error for a merchant with Japanese character as the displayName at completeMerchantValidation. The same works well if the merchant has name in English. log from com.apple.passkit as explained in Apple Pay on the Web Debugging Guide 2024-04-30 12:12:21.441231+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] Received <private> status: PKPaymentAuthorizationStatusSuccess 2024-04-30 12:12:21.441336+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] Evaluating merchant session using PROD trust policy. 2024-04-30 12:12:21.448371+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] State machine change state from PKPaymentAuthorizationStateClientCallback to PKPaymentAuthorizationStatePrepareTransactionDetails with param: <private> 2024-04-30 12:12:21.448393+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitMacHelper) [com.apple.passkit:PaymentUI] State change: PKPaymentAuthorizationStatePrepareTransactionDetails 2024-04-30 12:12:21.448444+0530 0xb6bd16 Error 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitMacHelper) [com.apple.passkit:PaymentUI] State change not implemented: PKPaymentAuthorizationStatePrepareTransactionDetails 2024-04-30 12:12:21.450878+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] Performing request: POST <private> { 7 <private> fields } 500 bytes 2024-04-30 12:12:22.642216+0530 0xbaa237 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] Task Completed: <private> 2024-04-30 12:12:22.642348+0530 0xbaa237 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] Response: <private> 400 Time profile: 1.19145 seconds { 6 <private> fields } 232 bytes 2024-04-30 12:12:22.642571+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Payment] State machine change state from PKPaymentAuthorizationStatePrepareTransactionDetails to PKPaymentAuthorizationStateFatalError with param: <private> 2024-04-30 12:12:22.642617+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitMacHelper) [com.apple.passkit:PaymentUI] State change: PKPaymentAuthorizationStateFatalError 2024-04-30 12:12:22.642757+0530 0xb6bd16 Error 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitMacHelper) [com.apple.passkit:PaymentUI] Payment failed with fatal error <private> 2024-04-30 12:12:22.643288+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Analytics] subject: inApp event: <private> 2024-04-30 12:12:22.659154+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitMacHelper) [com.apple.passkit:PaymentUI] glyphView - revealedErrorAction() 2024-04-30 12:12:24.633308+0530 0xb6bad7 Default 0x0 55529 0 Safari: (PassKitMacHelperTemp) [com.apple.passkit:Payment] Invalidate extension <private> identifier <private> 2024-04-30 12:12:24.653014+0530 0xb6bd16 Info 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Connections] PKInAppPaymentService:0x12bf1b660 (0x1290e2a80): Tearing down existing connection 2024-04-30 12:12:24.653173+0530 0xbaaa12 Info 0x0 68603 0 passd: [com.apple.passkit:Connections] PDXPCServiceListener 2 (0x127705150:55547): connection invalidated 2024-04-30 12:12:24.654891+0530 0xb6bd16 Default 0x0 55547 0 com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitCore) [com.apple.passkit:Analytics] subject: inApp event: <private> As we can see, com.apple.PassKit.PaymentAuthorizationUIExtension: (PassKitMacHelper) [com.apple.passkit:PaymentUI] Payment failed with fatal error <private>, how do we debug this further?
Posted
by
Post not yet marked as solved
0 Replies
16 Views
Hi everyone ! This post is a following of this one. I'm trying to make a .pkg out of two bundles that lands in two different folders, namely : ~/Library/Audio/Plug-Ins/VST3 ~/Library/Audio/Plug-Ins/Components I am still using the script described in the previous post. The installer works fine on the computer that builds the package, on another computer in installs successfully but the aforementioned folders remains empty. My main computer is a MPB M1 (Ventura), I also have a 2015 MBA (Monterey). I tried to make the package on the air and the problem is the same : works on the machine that makes it, not on the receiver. When I try to install to Desktop for test purposes : The MPB correctly ask me for password / touch ID to install permission to use desktop permission to access file in the downloads (which are the extracted file of the .pkg I guess). But nothings happens. The package correctly indicate an installation of ~30Mo so it is not empty. I also tried using the mid process package for one of the two files with the same problem. I tried to use the CLI installer in verbose mode but it doesn't gave much information on what it is actually doing. My two main guess would be : already existing package ID permissions stuff But I don't really know how i could test for this... I would be grateful for any insights, Have a nice day ! -Thomas PS : I haven't found a "package" or "distribution" tag so I used the debugging one, feel free to modify if something seems more appropriate
Posted
by
Post not yet marked as solved
0 Replies
16 Views
I have a glb model that is loading absolutely fine, repeatedly, in safari or chrome. There is only one texture that is 8192x8192 it never has a problem when loading in browser. when we embed the url into an app, the model loads the first few times (exiting the model and going back to the main menu and then reloading the model) but, after a few attempts, the texture fails to load. The model and all data is visible but the texture, itself, is black. why could this be happening? Is there something in the iOS code that is breaking it? Is the iOS code trying to automatically cache the texture and it’s running out of memory? anyone who can provide the help and support that we require will be much appreciated. thank you advance.
Posted
by
Post not yet marked as solved
0 Replies
18 Views
We run automated app uploads to Appstore Connect and TestFlight from our company servers, which are behind a firewall. Our firewall is configured to allow connections to the HTTPS servers listed in the Transporter User Guide The problem is, Apple adds new servers (e.g northamerica-1.object-storage.apple.com) to this list without prior announcements and this breaks our automated uploads because our firewalls are not yet updated with the new servers. Transporter logs report vague errors which are difficult to correlate with the new servers that were added. For example, the error msg is: [06:45:19]: [iTMSTransporter] data: null [06:45:19]: [iTMSTransporter] } [06:45:19]: [iTMSTransporter] buildAssetSpi: class BuildRelationshipsBuildAssetDescription { [06:45:19]: [iTMSTransporter] links: class AlbumLocalizationRelationshipsAlbumLinks { [06:45:19]: [iTMSTransporter] self: https://contentdelivery.itunes.apple.com/<redacted>/iris/v1/builds/<redacted>/relationships/buildAssetSpi [06:45:19]: [iTMSTransporter] related: https://contentdelivery.itunes.apple.com/MZContentDeliveryService/iris/v1/builds/<redacted>/buildAssetSpi [06:45:19]: [iTMSTransporter] } [06:45:19]: [iTMSTransporter] data: null [06:45:19]: [iTMSTransporter] } [06:45:19]: [iTMSTransporter] } [06:45:19]: [iTMSTransporter] links: class ResourceLinks { [06:45:19]: [iTMSTransporter] self: https://contentdelivery.itunes.apple.com/MZContentDeliveryService/iris/v1/builds/<redacted> [06:45:19]: [iTMSTransporter] } [06:45:19]: [iTMSTransporter] } [06:45:19]: [iTMSTransporter] [2024-03-11 06:45:17 GMT] <main> DBG-X: Returning 1 [06:45:19]: iTunes Transporter output above ^ [06:45:19]: <redacted>.ipa11966153618006795338-swinfo.plist (1) - Bad Status received from server: 401 The above error had nothing to do with authentication or incorrect tokens. We solved it by adding "northamerica-1.object-storage.apple.com" to our firewalls and retrying appstore connect upload. I'm trying to figure out ways to solve this problem. Is there any way to subscribe to Apple notification emails/RSS feeds etc to get to know about new servers being added ahead of time ? Are the wildcard domains - *.object-storage.apple.com *.blobstore.apple.com sufficient to cover any new server that Apple adds to the list mentioned in the Transporter Guide ?
Posted
by
Post not yet marked as solved
0 Replies
22 Views
App: "Nappkin" Apple ID: 639242085 Hi, We are getting several "Missing API declaration" warnings (see below) when submitting our iOS app to the AppStore. Our app doesn't not use the mentioned api's but apparently one or more of the libraries we use do. We have included a privacy manifest that states this fact (included below). Why are we still getting these warnings/errors when we have included a privacy manifest? If each framework used must have a manifest can you tell me which frameworks are in error? We have no influence on the contents of the frameworks used in our apps. How can we comply if a framework we use does not have a required manifest and is unable or unwilling to include it? Our app is a point-of-sale app used by 100's of professionals. We have been in the AppStore for more than 10 years. Our app is fully dependend on several frameworks and not being able to update our app will mean we have to close our business. Thanks! Willem Bison = Privacy manifest ==== <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>NSPrivacyAccessedAPITypes</key> <array> <dict> <key>NSPrivacyAccessedAPIType</key> <string>NSPrivacyAccessedAPICategoryDiskSpace</string> <key>NSPrivacyAccessedAPITypeReasons</key> <array> <string>Our app does not use this api directly but (apparently) an included framework does</string> </array> </dict> <dict> <key>NSPrivacyAccessedAPIType</key> <string>NSPrivacyAccessedAPICategorySystemBootTime</string> <key>NSPrivacyAccessedAPITypeReasons</key> <array> <string>Our app does not use this api directly but (apparently) an included framework does</string> </array> </dict> <dict> <key>NSPrivacyAccessedAPITypeReasons</key> <array> <string>NSUserDefault is used to store and retrieve several user preferences</string> </array> <key>NSPrivacyAccessedAPIType</key> <string>NSPrivacyAccessedAPICategoryUserDefaults</string> </dict> <dict> <key>NSPrivacyAccessedAPITypeReasons</key> <array> <string>Our app does not use this api directly but (apparently) an included framework does</string> </array> <key>NSPrivacyAccessedAPIType</key> <string>NSPrivacyAccessedAPICategoryFileTimestamp</string> </dict> </array> </dict> </plist> = Warnings ==== Hello, We noticed one or more issues with a recent submission for App Store review for the following app: Nappkin Version 179.0 Build 33854 Although submission for App Store review was successful, you may want to correct the following issues in your next submission for App Store review. Once you've corrected the issues, upload a new binary to App Store Connect. ITMS-91053: Missing API declaration - Your app’s code in the “Nappkin” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryFileTimestamp. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code. For more details about this policy, including a list of required reason APIs and approved reasons for usage, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api. ITMS-91053: Missing API declaration - Your app’s code in the “Nappkin” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryDiskSpace. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code. For more details about this policy, including a list of required reason APIs and approved reasons for usage, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api. ITMS-91053: Missing API declaration - Your app’s code in the “Nappkin” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategorySystemBootTime. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code. For more details about this policy, including a list of required reason APIs and approved reasons for usage, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api. ITMS-91053: Missing API declaration - Your app’s code in the “Nappkin” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryUserDefaults. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code. For more details about this policy, including a list of required reason APIs and approved reasons for usage, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api. Apple Developer Relations ============
Posted
by
wjb
Post not yet marked as solved
0 Replies
10 Views
I am not sure if this is just Xcode and Storekit2 behaving weird. I am getting all products every time during my testing, even though I have pricing enabled for US and non-US in the same subscription group. How do I handle this scenario? Isn't SubscriptionStoreView supposed to handle this by itself depending on media and purchases country? Thanks in advance for your response!
Posted
by
Post not yet marked as solved
0 Replies
13 Views
I noticed from the system requirements, TensorFlow only seems to support Python. Are there any plans to add JavaScript as TensorFlow has JS support? Thank you for your time...
Posted
by
Post not yet marked as solved
0 Replies
18 Views
codesign --sign "Apple Development: deok cheul kim (DK46XUS3ZB)" --deep --force --options=runtime --entitlements ./entitlements.plist --timestamp ./mediasend_PC_module_mac_V1.app codesign -vvv --deep --strict mediasend_PC_module_mac_V1.app mediasend_PC_module_mac_V1.app: valid on disk mediasend_PC_module_mac_V1.app: satisfies its Designated Requirement spctl --assess --type execute --verbose mediasend_PC_module_mac_V1.app mediasend_PC_module_mac_V1.app: rejected xcrun notarytool store-credentials "kdcProfile" --apple-id "kdc07..." --password "emfc-lmhz-kynx-xqyy" ditto -c -k --sequesterRsrc --keepParent mediasend_PC_module_mac_V1.app mediasend_PC_module_mac_V1.zip xcrun notarytool submit "mediasend_PC_module_mac_V1.zip" --keychain-profile "kdcProfile" --wait Conducting pre-submission checks for mediasend_PC_module_mac_V1.zip and initiating connection to the Apple notary service... Submission ID received id: 431e50cc-131a-48eb-be1e-6e1139dea347 Upload progress: 100.00% (15.7 MB of 15.7 MB) Successfully uploaded file id: 431e50cc-131a-48eb-be1e-6e1139dea347 path: /Users/sinaburo7/Desktop/appleCert/mediasend_PC_module_mac_V1.zip Waiting for processing to complete. Current status: Invalid............ Processing complete id: 431e50cc-131a-48eb-be1e-6e1139dea347 status: Invalid xcrun notarytool log 431e50cc-131a-48eb-be1e-6e1139dea347 --keychain-profile "kdcProfile" { "logFormatVersion": 1, "jobId": "431e50cc-131a-48eb-be1e-6e1139dea347", "status": "Invalid", "statusSummary": "Archive contains critical validation errors", "statusCode": 4000, "archiveFilename": "mediasend_PC_module_mac_V1.zip", "uploadDate": "2024-04-30T04:19:29.294Z", "sha256": "0661974c3a2e073ab21b15bd0c65a8647bfe756fa42e07d2bb0522a20850de32", "ticketContents": null, "issues": [ { "severity": "error", "code": null, "path": "mediasend_PC_module_mac_V1.zip/mediasend_PC_module_mac_V1.app/Contents/MacOS/mediasend_PC_module_mac_V1", "message": "The binary is not signed with a valid Developer ID certificate.", "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721", "architecture": "arm64" }, { "severity": "error", "code": null, "path": "mediasend_PC_module_mac_V1.zip/mediasend_PC_module_mac_V1.app/Contents/Frameworks/libtcl8.6.dylib", "message": "The binary is not signed with a valid Developer ID certificate.", "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721", "architecture": "arm64" }, { "severity": "error", "code": null, "path": "mediasend_PC_module_mac_V1.zip/mediasend_PC_module_mac_V1.app/Contents/Frameworks/libssl.3.dylib", "message": "The binary is not signed with a valid Developer ID certificate.", "docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087721", "architecture": "arm64" }, . . . . . This is how it went. I don't know why the error occurs. For reference, the python app was installed using the script below. pyinstaller --onedir --hidden-import=PIL --hidden-import=flask --hidden-import=psutil --hidden-import=requests --name mediasend_PC_module_mac_V1 --icon=logo3_iMf_icon.icns --noconsole --add- data="logo3_iMf_icon.icns:." --add-data="logo.png:." --add-data="wifi.gif:." --add-data="sleep.gif:." -d all album_mac.py
Posted
by
Post not yet marked as solved
0 Replies
48 Views
I am trying to download XCode apps from my Mac to my Apple Vision Pro for testing. I have tried following the instructions by going into Settings->General->Remote Devices on my Apple Vision Pro, but there my Mac does not show up as a possible connection. I have made sure that both devices are connected to the same WiFi network, updated my Mac to Sonoma, and updated my AVP to the latest OS, and everything else that it asks for. I am able to mirror my display from my Mac but downloading apps from XCode does not work. I have also looked to enable Developer Mode by going to Settings -> Privacy & Security -> Enable Developer Mode, but there is no option for enabling developer mode here. I initially thought that it is a Bonjour Protocol compatibility issue since both devices are on university wifi (WPA2-Enterprise), but I also tried connecting both over a WPA2-Normal which also did not work.
Posted
by
Post not yet marked as solved
0 Replies
40 Views
Hello, I am writing as I am seeing a very strange behavior when attempting to run an HKStatisticsCollectionQuery over multiple app starts. Steps: Initially load and launch my app into an iOS simulator (running iOS 17.2) via Xcode (version 15.3). Execute code path which invokes the following method below. Authorize necessary Read permission for the HKQuantityTypeIdentifierStepCount type. Observed that a non-nil HKStatisticsCollection is returned in the initialResultsHandler, with corresponding expected datapoints. These datapoints are in no way stored or retained on the device at all. Stop the app via Xcode. Relaunch the app via Xcode. Execute the same code path as in step 2. Observed (via breakpoints) that even though the query is executed by the HKHealthStore, the initialResultsHandler is never called and no HKStatisticsCollection is ever returned. Input parameters are the same in both instances of the call, and can confirm there is data in the devices HealthKit datastore. I would expect, reading Apple's documentation, that both queries should execute and return the exact same datapoints in an HKStatisticsCollection, but please feel free to correct me if I am misunderstanding something, or if my code is incorrect in some way. func fetchStatisticsCollection(with quantityType: HKQuantityType, predicate: NSPredicate? = nil, options: HKStatisticsOptions, anchorDate: Date? = nil, interval: DateComponents? = nil, initialResultsCompletion: @escaping (Result<HKStatisticsCollection, Error>) -> Void, updateHandler: (Result<HKStatisticsCollection, Error>) -> Void?) { var statisticsQueryAnchorDate: Date = Date() if let anchor = anchorDate { statisticsQueryAnchorDate = anchor } else if let yesterdayAnchor = createStaticsQueryAnchorDateYesterday(){ statisticsQueryAnchorDate = yesterdayAnchor } let dateInterval = interval ?? DateComponents(day: 1) // Create the query let query = HKStatisticsCollectionQuery(quantityType: quantityType, quantitySamplePredicate: predicate, options: options, anchorDate: statisticsQueryAnchorDate, intervalComponents: dateInterval) // Set the results handler query.initialResultsHandler = { query, results, error in if let error = error as? HKError{ // Return wrapped HKError initialResultsCompletion(.failure(HealthKitManagerError.hkError(error: error))) return } guard let statsCollection = results else { // Return custom Empty Results error. initialResultsCompletion(.failure(HealthKitManagerError.emptyResults)) return } initialResultsCompletion(.success(statsCollection)) } if let updateHandler = updateHandler { query.statisticsUpdateHandler = { query, statistics, statisticsCollection, error in if let error = error as? HKError{ // Return custom wrapped HKError. updateHandler(.failure(HealthKitManagerError.hkError(error: error))) return } guard let statsCollection = statisticsCollection else { // Return custom Empty Results error. updateHandler(.failure(HealthKitManagerError.emptyResults)) return } updateHandler(.success(statsCollection)) } } if activeTypeQueries[quantityType.identifier] == nil { healthStore.execute(query) activeTypeQueries[quantityType.identifier] = query healthStore.enableBackgroundDelivery(for: quantityType, frequency: .immediate) { (success, error) in if let error = error { return } if success { print("background enabled") } } } else { print("NOT executing query, we already have one query running for this type") } } Thank you
Posted
by
Post not yet marked as solved
0 Replies
49 Views
I'm working on creating a locker app to lock the selected applications. After locking app, when you try to open the app a screen appears with the below message. Icon Restricted You can not use Facetime because it is restricted OK Button. How to customise this screen, another locker app is able to customise it and on a button click it redirects to their app to unlock it. also is there a way to get locked app names?
Posted
by
Post not yet marked as solved
0 Replies
55 Views
I am trying to present a GroupActivitySharingController using SwiftUI. I am using a NSViewControllerRepresentable: @State var event : Event func makeNSViewController(context: NSViewControllerRepresentableContext<MeetingGroupActivitySharingRepresentableView>) -> GroupActivitySharingController { return try! GroupActivitySharingController(MeetingGroupActivity(event: event)) } func updateNSViewController(_ nsViewController: GroupActivitySharingController , context: NSViewControllerRepresentableContext<MeetingGroupActivitySharingRepresentableView>) { print("Updating VC") } } I present it as following : .sheet(isPresented: $showGroupActivitySharingView) { MeetingGroupActivitySharingRepresentableView(event: observedEvent.event) } It works fine on iOS, however on MacOS, I cannot dismiss the view. I see the following error: dismissViewController:: Error: maybe this view controller was not presented? ( 0 CoreFoundation 0x000000019d75accc __exceptionPreprocess + 176 1 libobjc.A.dylib 0x000000019d242788 objc_exception_throw + 60 2 Foundation 0x000000019e8cbc6c -[NSCalendarDate initWithCoder:] + 0 3 AppKit 0x00000001a145a77c -[NSViewController dismissViewController:] + 224 4 _GroupActivities_AppKit 0x0000000232d65cf0 $s23_GroupActivities_AppKit0A25ActivitySharingControllerC011dismissViewG06resultyAA0aeF6ResultO_tFyyYaYbScMYccfU_TY0_ + 444 5 _GroupActivities_AppKit 0x0000000232d67b65 $s23_GroupActivities_AppKit0A25ActivitySharingControllerC011dismissViewG06resultyAA0aeF6ResultO_tFyyYaYbScMYccfU_TATQ0_ + 1 6 _GroupActivities_AppKit 0x0000000232d68bd9 $sIeghH_ytIeghHr_TRTQ0_ + 1 7 _GroupActivities_AppKit 0x0000000232d68bdd $sIeghH_ytIeghHr_TRTATQ0_ + 1 8 _GroupActivities_AppKit 0x0000000232d66931 $sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5TQ0_ + 1 9 _GroupActivities_AppKit 0x0000000232d68ba5 $sxIeghHr_xs5Error_pIegHrzo_s8SendableRzs5NeverORs_r0_lTRyt_Tg5TATQ0_ + 1 10 libswift_Concurrency.dylib 0x0000000263cfb0f9 _ZL23completeTaskWithClosurePN5swift12AsyncContextEPNS_10SwiftErrorE + 1 ) Any idea what is going on?
Posted
by
Post not yet marked as solved
0 Replies
53 Views
Hello everyone! I recently started to think to introduce in my app SplitView for iPads instead of TabView which I currently have. But I would like to keep the TabView for iPhone and compact size class of iPad. I took my inspiration from a lot of Apple apps, like Apple Music or Photos. I was also looking at the Fruta app where similar technique is implemented, but that particular implementation does not fit my needs. The problem I’m having is that every time SplitView changes to TabView or vise versa the whole state of the app resets. I tried everything I could imagine, I couldn’t find a way to overcome this issue. The only thing I was able to fix is to maintain the same tab/list item selection, but everything else resets. Could anybody help me to resolve this issue? Thanks!
Posted
by
Post not yet marked as solved
0 Replies
53 Views
I am working on ScreenCaptureKit sample with SCContentSharingPickerObserver. My Target is SwiftUI based and calling Objective-C class method. I added [MyTarget]-Bridging.h and [MyTarget]-Swift.h I got compile error of unknown class name SCContentSharingPickerObserver in [MyTarget]-Swift.h. But I do not know how to fix this error since [MyTarget]-Swift.h is Xcode generated file. I set macOS target is 14.0, swift language ver is 5 Anyone know how to fix this error or waiting for Xcode update?
Posted
by

TestFlight Public Links

Get Started

Pinned Posts

Categories

See all