Post

Replies

Boosts

Views

Activity

CKError - Service Unavailable
I'm repeatedly getting this error on one - but not all - CKQuery operation:CKError(_nsError: <CKError 0x608000846ff0: "Service Unavailable" (6/2022); "Request failed with http status code 503">)There's no further useful info in the UserInfo dictionary, including no value for the CKErrorRetryAfterKey.My code initially queries CloudKit for basically two fields: "name" and "hash". Hash is a hash value for a CKAsset file (on the same record) that I don't want to download unless the hash code indicates that the file has changed.For all the records whose hash codes indicate that I should download the CKAsset, I prepare the same query in the same code, but add the "json" field and rerun, to download only the json files that I need. I use this predicate, containing an array of the desired CKReferences NSPredicate.init(format: "recordID in %@", fullRecordsToDownload)The first query always works, the second always fails with the 503. Every time I repeat, it's the same pattern.Thus it can't really be that the service is unavailable, right?How can I diagnose this?
4
0
2.6k
Jul ’17
iOS App crashes on rotation while in the background
I'm developing an iOS app that can receive silent remote notifications, so that it's occasionally active in the background.I've received several crash logs that seemingly indicate the app crashes when the device is rotated while the app is in the background. It's near impossible for me to reproduce, and it does not occur while responding to a silent notification. From other logging, it appears the app is quiescent.Any idea why a background app would react to device rotation?There are similar queries about this type of thing on stackoverflow https://stackoverflow.com/questions/59287580/ios-crash-with-spritekit-when-app-is-in-background and https://stackoverflow.com/questions/59863771/ios-13-crash-with-uibuttonbarstackview-possibly-on-rotation.Relevant crash data is as follows: Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x0000000104cb8f24 Termination Signal: Trace/BPT trap: 5 Termination Reason: Namespace SIGNAL, Code 0x5 Terminating Process: exc handler [11726] Triggered by Thread: 0 Thread 0 name: Thread 0 Crashed: 0 [MyAppName] 0x0000000104cb8f24 specialized [MyAppsViewController].collectionView(_:layout:sizeForItemAt:) + 1512 (<compiler-generated>:0) 1 [MyAppName] 0x0000000104cb6c1c @objc [MyAppsViewController].collectionView(_:layout:sizeForItemAt:) + 164 (<compiler-generated>:0) 2 UIKitCore 0x00000001941c9030 -[UICollectionViewFlowLayout _getSizingInfosWithExistingSizingDictionary:] + 2972 (UICollectionViewFlowLayout.m:1443) 3 UIKitCore 0x00000001941ca5b0 -[UICollectionViewFlowLayout _fetchItemsInfoForRect:] + 260 (UICollectionViewFlowLayout.m:1675) 4 UIKitCore 0x00000001941c4238 -[UICollectionViewFlowLayout prepareLayout] + 220 (UICollectionViewFlowLayout.m:376) 5 UIKitCore 0x00000001941bd7bc -[UICollectionViewData _prepareToLoadData] + 228 (UICollectionViewData.mm:334) 6 UIKitCore 0x00000001941be050 -[UICollectionViewData validateLayoutInRect:] + 104 (UICollectionViewData.mm:400) 7 UIKitCore 0x000000019418f434 -[UICollectionView layoutSubviews] + 224 (UICollectionView.m:3949) 8 UIKitCore 0x0000000194db73d0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2140 (UIView.m:17028) 9 QuartzCore 0x000000019731a7dc -[CALayer layoutSublayers] + 284 (CALayer.mm:9627) 10 QuartzCore 0x0000000197320958 CA::Layer::layout_if_needed(CA::Transaction*) + 480 (CALayer.mm:9501) 11 UIKitCore 0x0000000194da3684 -[UIView(Hierarchy) layoutBelowIfNeeded] + 536 (UIView.m:12017) 12 UIKitCore 0x0000000194279358 -[UINavigationController _layoutViewController:] + 1188 (UINavigationController.m:6432) 13 UIKitCore 0x0000000194273210 -[UINavigationController _layoutTopViewControllerLookForNested:] + 604 (UINavigationController.m:4871) 14 UIKitCore 0x0000000194269ab8 __105-[UINavigationController _repositionPaletteWithNavigationBarHidden:duration:shouldUpdateNavi... + 716 (UINavigationController.m:2677) 15 UIKitCore 0x00000001942697b4 -[UINavigationController _repositionPaletteWithNavigationBarHidden:duration:shouldUpdateNavigatio... + 264 (UINavigationController.m:2694) 16 UIKitCore 0x00000001942723d8 -[UINavigationController _updateBarsForCurrentInterfaceOrientationAndForceBarLayout:] + 176 (UINavigationController.m:4645) 17 UIKitCore 0x0000000194332600 -[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] + 264 (UIViewControllerTransitioning.m:1140) 18 UIKitCore 0x000000019432efb0 -[_UIViewControllerTransitionContext __runAlongsideAnimations] + 256 (UIViewControllerTransitioning.m:411) 19 UIKitCore 0x0000000194dab530 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animat... + 564 (UIView.m:14134) 20 UIKitCore 0x0000000194dabb10 +[UIView(UIViewAnimationWithBlocks) animateWithDuration:delay:options:animations:completion:] + 108 (UIView.m:14193) 21 UIKitCore 0x0000000194344f60 __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke_2 + 308 (_UIWindowAnimationController.m:187) 22 UIKitCore 0x0000000194daf484 +[UIView(Internal) _performBlockDelayingTriggeringResponderEvents:forScene:] + 204 (UIView.m:15076) 23 UIKitCore 0x0000000194344ccc __58-[_UIWindowRotationAnimationController animateTransition:]_block_invoke + 164 (_UIWindowAnimationController.m:176) 24 UIKitCore 0x0000000194344ba4 -[_UIWindowRotationAnimationController animateTransition:] + 492 (_UIWindowAnimationController.m:227) 25 UIKitCore 0x000000019495fb1c -[UIWindow _rotateToBounds:withAnimator:transitionContext:] + 580 (UIWindow.m:3539) 26 UIKitCore 0x000000019496211c -[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:] + 1436 (UIWindow.m:4071) 27 UIKitCore 0x0000000194962634 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 412 (UIWindow.m:4105) 28 UIKitCore 0x00000001949619e8 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 128 (UIWindow.m:3947) 29 UIKitCore 0x0000000194960954 __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 124 (UIWindow.m:3657) 30 UIKitCore 0x000000019496085c -[UIWindow _updateToInterfaceOrientation:duration:force:] + 436 (UIWindow.m:3703) 31 CoreFoundation 0x000000019080a288 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20 (CFNotificationCenter.c:787) 32 CoreFoundation 0x000000019080a2d0 ___CFXRegistrationPost1_block_invoke + 64 (CFNotificationCenter.c:175) 33 CoreFoundation 0x0000000190809630 _CFXRegistrationPost1 + 368 (CFNotificationCenter.c:198) 34 CoreFoundation 0x00000001908092e8 ___CFXNotificationPost_block_invoke + 104 (CFNotificationCenter.c:1371) 35 CoreFoundation 0x000000019078559c -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1416 (CFXNotificationRegistrarOld.m:168) 36 CoreFoundation 0x0000000190808c38 _CFXNotificationPost + 1244 (CFNotificationCenter.c:1359) 37 Foundation 0x0000000190b65138 -[NSNotificationCenter postNotificationName:object:userInfo:] + 60 (NSNotification.m:576) 38 UIKitCore 0x000000019459f128 -[UIDevice setOrientation:animated:] + 252 (UIDevice.m:799) 39 UIKitCore 0x00000001940ed96c __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransiti... + 1568 (_UISceneLifecycleMultiplexer.m:557) 40 UIKitCore 0x0000000194582b70 _UIScenePerformActionsWithLifecycleActionMask + 100 (_UISceneLifecycleState.m:109) 41 UIKitCore 0x00000001940ed2b0 __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransiti... + 196 (_UISceneLifecycleMultiplexer.m:501) 42 UIKitCore 0x00000001940ecd08 -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 296 (_UISceneLifecycleMultiplexer.m:450) 43 UIKitCore 0x00000001940ed0dc -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionSto... + 736 (_UISceneLifecycleMultiplexer.m:500) 44 UIKitCore 0x00000001940ec998 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 336 (_UISceneLifecycleMultiplexer.m:406) 45 UIKitCore 0x00000001940f0e84 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsFo... + 188 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:102) 46 UIKitCore 0x00000001944b43e0 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 824 (BSAnimationSettings+UIKit.m:50) 47 UIKitCore 0x000000019459c15c _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 244 (_UISceneSettingsDiffAction.m:43) 48 UIKitCore 0x00000001940f0bbc __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsFo... + 136 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:87) 49 UIKitCore 0x000000019459c058 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 100 (_UISceneSettingsDiffAction.m:35) 50 UIKitCore 0x00000001940f0a28 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUISc... + 376 (_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction.m:85) 51 UIKitCore 0x0000000193f62880 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 636 (UIScene.m:1338) 52 UIKitCore 0x0000000193f613e8 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 248 (UIScene.m:1071) 53 UIKitCore 0x0000000193f625b8 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 220 (UIScene.m:1315) 54 UIKitCore 0x00000001944d5248 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 464 (UIApplicationSceneClientAgent.m:80) 55 FrontBoardServices 0x00000001959cf248 -[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:] + 544 (FBSSceneImpl.m:551) 56 FrontBoardServices 0x00000001959f3d28 __88-[FBSWorkspaceScenesClient sceneID:updateWithSettingsDiff:transitionContext:completion:]_bloc... + 120 (FBSWorkspaceScenesClient.m:356) 57 FrontBoardServices 0x00000001959d8f04 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 232 (FBSWorkspace.m:357) 58 FrontBoardServices 0x00000001959f3c5c __88-[FBSWorkspaceScenesClient sceneID:updateWithSettingsDiff:transitionContext:completion:]_bloc... + 184 (FBSWorkspaceScenesClient.m:355) 59 libdispatch.dylib 0x000000019057b184 _dispatch_client_callout + 16 (object.m:495) 60 libdispatch.dylib 0x0000000190523fd8 _dispatch_block_invoke_direct$VARIANT$mp + 224 (queue.c:466) 61 FrontBoardServices 0x0000000195a18418 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40 (FBSSerialQueue.m:173) 62 FrontBoardServices 0x0000000195a180e4 -[FBSSerialQueue _queue_performNextIfPossible] + 404 (FBSSerialQueue.m:216) 63 FrontBoardServices 0x0000000195a1860c -[FBSSerialQueue _performNextFromRunLoopSource] + 28 (FBSSerialQueue.m:247) 64 CoreFoundation 0x000000019082ca00 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1922) 65 CoreFoundation 0x000000019082c958 __CFRunLoopDoSource0 + 80 (CFRunLoop.c:1956) 66 CoreFoundation 0x000000019082c0f0 __CFRunLoopDoSources0 + 180 (CFRunLoop.c:1992) 67 CoreFoundation 0x000000019082723c __CFRunLoopRun + 1080 (CFRunLoop.c:2882) 68 CoreFoundation 0x0000000190826adc CFRunLoopRunSpecific + 464 (CFRunLoop.c:3192) 69 GraphicsServices 0x000000019a7ac328 GSEventRunModal + 104 (GSEvent.c:2246) 70 UIKitCore 0x0000000194921ae0 UIApplicationMain + 1936 (UIApplication.m:4773) 71 [MyAppName] 0x0000000104bc534c main + 68 ([MyAppsUIControl].swift:18) 72 libdyld.dylib 0x00000001906b0360 start + 4
0
0
1.8k
Feb ’20
For an app in TestFlight, initial onboarding UI is obscured
I have an initial onboarding video in my app that gets occluded by the TestFlight overlaid introductory UI - the two screens, the first screen titled "From the Developer", and the second is "Share Feedback".By the time the beta tester gets past those two screens, my introductory video has completed, and the user doesn't even really know what they missed. Is there any way that I can turn that off? Or any TestFlight-related API that will tell me when those two screens have been dismissed? My app is live and up and running in the background, so the usual lifecycle methods of viewDidLoad, viewWillAppear, etc., are all called even though the screens are not visible.
1
0
1.4k
Mar ’20
WCSession isComplicationEnabled() always false w simulator?
In my iOS app, I check to see if there's an active complication before sending complication data to the watch, given the limit of 50 transfers per day. It seems isComplicationEnabled() always returns false in the simulator, even though I have a watch app in a watchOS simulator that's active and running, with complications that actively get updated from the watch code as well. Data is successfully being passed from the simulated iPhone to the simulated watch app - both are active, connected and otherwise in sync. When I run using a physical device, WCSession isComplicationEnabled() on my iPhone does return true, but it seems to always be false in the simulator. Is this a limitation? Bug? Anyone else seeing this?
3
1
1.9k
Jun ’20
Unable to install watch app to physical device
I am unable to successfully install a watch app from either of two different iOS apps in Xcode 11.5 (one is the SimpleWatchConnectivity WatchKit App that Apple posted). My watch is paired with the iPhone, and all other data syncs properly. The iPhone is plugged directly into my MacBook Pro, and the watch is inches away, with no discernible issues with wifi or bluetooth. The iOS app gets installed properly to the iPhone, but Xcode fails when I try to build and run the watch component. I get "Unable to install SimpleWatchConnectivity WatchKit App", and upon hitting details, I get the following error about the device no longer being connected (???) Any ideas? Unable to install "SimpleWatchConnectivity WatchKit App" Domain: com.apple.dt.MobileDeviceErrorDomain Code: -402653052 -- This device is no longer connected. Domain: com.apple.dt.MobileDeviceErrorDomain Code: -402653052 User Info: {     DVTRadarComponentKey = 261622;     MobileDeviceErrorCode = "(0xE8000084)";     "com.apple.dtdevicekit.stacktrace" = ( 0   DTDeviceKitBase                     0x000000011dd2d81a DTDKCreateNSErrorFromAMDErrorCode + 233 1   DTDeviceKitBase                     0x000000011dd6ef70 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155 2   DVTFoundation                       0x000000010409c155 DVTInvokeWithStrongOwnership + 73 3   DTDeviceKitBase                     0x000000011dd6eca8 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1654 4   IDEiOSSupportCore                   0x000000011dbe5e91 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4165 5   DVTFoundation                       0x00000001041cf7f4 __DVT_CALLING_CLIENT_BLOCK__ + 7 6   DVTFoundation                       0x00000001041d1436 __DVTDispatchAsyncblockinvoke + 1194 7   libdispatch.dylib                   0x00007fff73cef6c4 _dispatch_call_block_and_release + 12 8   libdispatch.dylib                   0x00007fff73cf0658 _dispatch_client_callout + 8 9   libdispatch.dylib                   0x00007fff73cf5c44 _dispatch_lane_serial_drain + 597 10  libdispatch.dylib                   0x00007fff73cf65d6 _dispatch_lane_invoke + 363 11  libdispatch.dylib                   0x00007fff73cffc09 _dispatch_workloop_worker_thread + 596 12  libsystem_pthread.dylib             0x00007fff73f4aa3d _pthread_wqthread + 290 13  libsystem_pthread.dylib             0x00007fff73f49b77 start_wqthread + 15 ); } -- System Information macOS Version 10.15.5 (Build 19F101) Xcode 11.5 (16139)
0
0
964
Jul ’20
Watch complications not available on iOS 14 / watchOS 6
I'm running iOS 14 on a test device, with a paired watch on watchOS 6. My app is written for minimum iOS 11, while its watch app requires watchOS 6. In testing for iOS 14, the app runs properly on the iPhone, and the watch app appears and functions properly on the paired watch. However, the complication name for my app does not appear in the list in the Watch app on iOS, or in selecting a complication in the Customize UI on the watch itself. Everything is fine with another phone/watch running iOS 13/watchOS 6 respectively. Neither the iOS nor the watch app uses anything in the beta - i.e., the complications are mostly just images, with none of the new SwiftUI capabilities. What could cause the app's name not to appear in the complications list?
3
0
1.5k
Aug ’20
Specific meaning on iOS of: WCSession activationState == activated
What specifically does it mean when the WCSession activationState == activated? I had originally thought it meant the iOS app would be able to communicate with the paired watch, but I'm seeing the activationState set to activated even when the paired watch is powered off or otherwise inaccessible. If it means iOS can reach some paired watch, but if it says nothing about whether it can do it right now, how can I tell if in fact the watch - not the companion app, the watch itself - is accessible?
2
0
1.3k
Aug ’20
Core data inaccessible when app launched by silent push notifications post-background crash
If an iOS app crashes in the background, silent push notifications are supposed to be able to relaunch the app, and I've seen this to be true. However, my app uses core data, so when the app re-launches in the background on a locked device, the core data resources are inaccessible until the device is unlocked. I rely on what's in core data to process the incoming data, and so updates to the Today Widget or Apple Watch complications don't occur in a timely manner. I also rely on these updates to generate local notifications and to provide responses via Siri. All of these interfaces are accessible to the user while the device is locked. But the core data is not. Am I understanding this correctly, and is this the expected behavior? Any way around it?
2
0
1.9k
Aug ’20
iOS 14: Images in local notifications are fuzzy
My app generates local notifications, with attached circular images that provide a graphic state indicator. For the indicator: I use a short, wide image (aspect ratio 1:6), with the circular indicator in the middle. This technique allows the the circular image to appear properly when the notification arrives, and prevents the image from being scaled to an unwanted, unnecessarily large size when the notification is opened. With iOS 14, the images on the arriving notifications are unacceptably fuzzy (blurred, pixelated), but remain crystal clear when the notification is opened. On prior versions of iOS, the images were always crystal clear, when arriving in notification center, as well as when opened. This is obviously a change from iOS 13 to 14. Any workarounds? Anyone else experiencing this?
1
0
1.5k
Sep ’20
Silent Push Notifications - Call CompletionHandler after timeout?
My iOS app uses silent push notifications via application:didReceiveRemoteNotification:fetchCompletionHandler to trigger background refreshes. Occasionally a refresh will time out, and when the next silent notification comes in, the original process will complete. Example: SilentNotification SN1 with CompletionHandler CH1 is received A background refresh process BR1 begins, but times out SN2 later arrives, with CH2 BR1 continues now that iOS has awakened the app, and runs to completion (There's no BR2, since I'm able to detect that the BR1 is still able to be completed) Which CompletionHandler do I call? Should I hold onto CH1 and call it when the refresh completes, even though it's running in SN2's time allocation? Do I call CH2 instead? Both?
3
0
1.3k
Mar ’21