Post

Replies

Boosts

Views

Activity

Crash on [AVPlayer _addLayer] in iOS 16 caused by Pegasus
Hi, Our apps currently facing a crash that only happens in iPhone with iOS 16. Unfortunately, we could not reproduce this issue, neither from XCode build or App store build. From third party crash analytics, it happens mostly of background and they highlighted this as the issue. Fatal Exception: NSInvalidArgumentException *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil And the stack trace, it shows: AVFCore __22-[AVPlayer _addLayer:]_block_invoke Pegasus __116-[PGPictureInPictureProxy _endDeactivatingPictureInPictureIfNeededWithAnimationType:stopReason:cleanupHandlerOrNil:]_block_invoke We also attach the full crash log to give full context of the crash. Any idea why this crash happens and is there anything i can do to prevent the crashes from happening again? pegasus.crash
14
6
4.6k
Oct ’22
Can't manage my sandbox account
Hi, I can't get into "manage" sandbox account. I either get to a screen to put my password in. Here there is no way to click "next" or "login". (I have tried pressing "enter" on my keyboard to no effect). Or I get directly into "Cannot Connect" page. I have tried this two days in a row. I have tried turning it off and on again. I have tried logging out and in. Device: iPhone 13 pro max, iOS: 16.0.3 (also tried the version before this)
67
11
26k
Oct ’22
Encountering Error Domain=NSCocoaErrorDomain Code=513 while creating hard link between files on MacOS(Mac Catalyst App)
Hi, I am trying to create a hard link on MacOS(Mac Catalyst App) between files using [self linkItemAtURL:fromURL toURL:toURL error:&error]; Source Path for MacOS - /var/folders/lf/dt_4nxd945jdry2241phx0_40000gn/T/net.appname.AppName/documents/... Destination Path for MacOS - /Users/username/Library/Group Containers/group.net.appname.AppName.shared/Message/Media/... Although the same code works fine on iOS, but getting following error on MacOS Error Domain=NSCocoaErrorDomain Code=513 couldn’t be linked because you don’t have permission to access, Operation not permitted Source Path for iOS - /Users/user/Library/Developer/CoreSimulator/Devices/B4054540-345F-4D90-A3C5-DA6E6469A3FC/data/Containers/Data/Application/B4AB7D70-491C-49E5-9A3F-27E66EC3423D/tmp/documents/... Destination Path for iOS - /Users/user/Library/Developer/CoreSimulator/Devices/B4054540-345F-4D90-A3C5-DA6E6469A3FC/data/Containers/Shared/AppGroup/842B248E-CCA6-4B5C-82BD-2858EADD3A90/Message/Media/... However, interestingly if I try to copy the file, it works perfectly fine on MacOS as well. I am unable to understand if it is the permission issue, it should not work with copy as well. Does anyone have any reason/solution to this behaviour?
5
0
1.4k
Oct ’22
"Failed to set up CloudKit integration" in TestFlight build
I'm building a macOS + iOS SwiftUI app using Xcode 14.1b3 on a Mac running macOS 13.b11. The app uses Core Data + CloudKit. With development builds, CloudKit integration works on the Mac app and the iOS app. Existing records are fetched from iCloud, and new records are uploaded to iCloud. Everybody's happy. With TestFlight builds, the iOS app has no problems. But CloudKit integration isn't working in the Mac app at all. No existing records are fetched, no new records are uploaded. In the Console, I see this message: error: CoreData+CloudKit: Failed to set up CloudKit integration for store: <NSSQLCore: 0x1324079e0> (URL: <local file url>) Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.cloudd was invalidated: failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.cloudd was invalidated: failed at lookup with error 159 - Sandbox restriction.} I thought it might be that I was missing the com.apple.security.network.client entitlement, but adding that didn't help. Any suggestions what I might be missing? (It's my first sandboxed Mac app, so it might be really obvious to anyone but me.)
3
0
2.7k
Oct ’22
dispatch_async_f does not return immediatly
Hi, I work on a game for iOS and the framerate decreases progressively when the debugger is attached. Running it for 2mins, it went from 30 to 1 FPS while rendering a simple static scene. I narrowed it down to a call to dispatch_async_f which takes longer to execute over time. clock_t t1 = clock(); dispatch_async_f(queue, context, function); clock_t t2 = clock(); double duration = (double)(t2 -t1)/(double)CLOCKS_PER_SEC; Dodumentation says dispatch_async_f is supposed to return immediatly. So what could explain duration to increases in debug? Am i measuring this incorrectly? The game is written in mixed C++ and ObjC. It uses Metal as graphic API and GCD for dispatching jobs. I have Xcode 13.4.1 and test on an iPhone 13 Pro with iOS 15.7. Thanks.
10
0
2.2k
Oct ’22
CLKComplicationWidgetMigrator not working
I'm trying to migrate from Complication with CLKComplication to WidgetKit. I have implemented the required methods in https://developer.apple.com/documentation/widgetkit/converting-a-clockkit-app, but the migration is not working. There is no evidence that the method for migration is also called. It was the same with Xcode 14.0.1 and Xcode 14.1RC. class ComplicationController: NSObject, CLKComplicationDataSource, CLKComplicationWidgetMigrator { ...     @available(watchOS 9.0, *)     var widgetMigrator: CLKComplicationWidgetMigrator {         return self     }     @available(watchOS 9.0, *)     func widgetConfiguration(from complicationDescriptor: CLKComplicationDescriptor) async -> CLKComplicationWidgetMigrationConfiguration? {         return CLKComplicationStaticWidgetMigrationConfiguration(kind: "MyWidget", extensionBundleIdentifier: "com.example.myapp.mywatchkitapp.mywidget")     } } What's wrong? Has anyone been able to migrate?
7
1
1.9k
Oct ’22
NWListener, P2P and awdl interfaces
I'm attempting to create a service that: Listens on iOS device A using NWListener Broadcasts the NWService ( using NWListener(service:using:)) ) on Bonjour Allows a separate device, iOS device B, to receive information about that service via an NWBrowser Connect to that service using the information contained in NWBrowser.Result 's NWEndpoint I've been able to successfully do this using a SwiftNIO service, in the following environments: iOS device A and iOS device B are physical iOS devices on the same WiFi network. This works. iOS device A and iOS device B are iOS simulators on the same machine. This works. iOS device A is a physical device, and iOS device B is a simulator. iOS device A is not connected to a WiFi network, iOS device B is connected to a WiFi network. This works. However, when iOS device A and iOS device B are physical devices that are not connected to a WiFi network, I encounter the following behavior: The Bonjour service is correctly advertised, and iOS device A and iOS device B are able to observe the advertisement of the service. In both cases, iOS device A and iOS device B, while able to resolve an NWEndpoint for the Bonjour service, are not able to connect to each other, and the connection attempt hangs. My setup for the listener side of things looks roughly like: let opts: NWParameters = .tcp opts.includePeerToPeer = true opts.allowLocalEndpointReuse = true let service = NWListener.Service(name: "aux", type: BONJOUR_SERVICE_TYPE, domain: "") try bootstrap.withNWListener(NWListener(service: service, using: opts)).wait() // bootstrap is an artifact of using SwiftNIO Similarly, my setup on the discovery side of things looks like: let params: NWParameters = .tcp params.includePeerToPeer = true let browser = NWBrowser(for: .bonjour(type: BONJOUR_SERVICE_TYPE, domain: BONJOUR_SERVICE_DOMAIN), using: params) browser.browseResultsChangedHandler =  { (searchResults, changed) in // save the result to pass on its NWEndpoint later } and finally, where I have an NWEndpoint, I use SwiftNIO's NIOTSConnectionBootstrap.connect(endpoint:) to initialize a connection to my TCP service ( a web socket server ). The fact that I am able to get P2P networking (presumably over an awdl interface?) between the simulator and the iOS device suggests to me that I haven't done anything obviously wrong in my setup. Similarly, the fact that it works over the same WiFi network and that, in P2P, I am able to at least observe the Bonjour advertisement, strikes me that I'm somewhere in the right neighborhood of getting this to work. I've also ensured that my Info.plist for the app has a NSLocalNetworkUsageDescription and NSBonjourServices for the Bonjour service type I'm browsing for. I've even attempted to exercise the "Local Network Permission" dialog by using a hacky attempt that sends data to a local IP in order to trigger a permissions dialog, though the hack does not appear to actually force the dialog to appear. Is there some trick or other piece of knowledge regarding allowing the use of P2P w/ Network.framework and TCP connections to services?
7
0
1.5k
Oct ’22
Bluetooth issue of macOS Ventura
Always failed to add IOBluetoothSDPServiceRecord in macOS Ventura As the title said, after I called the method "publishedServiceRecordWithDictionary", the Bluetooth XPC connection would always be interrupted and reset. The same code that I run in macOS Monterey is well executed without any warning. And I got the following logs : [CoreBluetooth] XPC connection interrupted, resetting [IOBluetooth] Failed to add service record [CoreBluetooth] XPC connection interrupted, resetting [CoreBluetooth] XPC connection interrupted, resetting [CoreBluetooth] XPC connection interrupted, resetting [CoreBluetooth] XPC connection interrupted, resetting
8
1
2.9k
Oct ’22
Is "CarPlay.app" malware or a bug?
Why is "CarPlay.app" text shown in Location Services? All other app listings display an icon instead of text - so this looks suspicious. It may be a bug though. Has anyone else seen this? I’ve filed this via Apple Feedback app but no response from Apple yet. Device is running iOS 16.2beta.
2
0
1.9k
Nov ’22
Open parent app from ShieldAction extension in iOS
When I tap on one of the buttons in the ShieldAction extension I want to close the shield and open the parent app instead of the shielded app. Is there any way of doing this using the Screen Time API? class ShieldActionExtension: ShieldActionDelegate {      override func handle(action: ShieldAction, for application: ApplicationToken, completionHandler: @escaping (ShieldActionResponse) -> Void) {     // Handle the action as needed.           let store = ManagedSettingsStore()               switch action {     case .primaryButtonPressed:       //TODO - open parent app       completionHandler(.defer)     case .secondaryButtonPressed:       //remove shield       store.shield.applications?.remove(application)       completionHandler(.defer)         @unknown default:       fatalError()     }   }   }
8
7
3.5k
Nov ’22
XCode 14.x, adding Watch to existing and WCSession isWatchAppInstalled = false
I added a Watch app to an existing iOS app using XCode 14.1. (single target template) When using WCSession delegate, so I can message between the apps, I always get isWatchAppInstalled = false. If Icreate the same scenario using XCode 13.x, I have no issues. Has anyone been able to add a watch app to an existing iOS app, create a WCSession object and have isWatchAppInstalled = true? print("Session:activationDidCompleteWith --> IsPaired[(String(describing: session.isPaired))] isWatchAppInstalled[(String(describing: session.isWatchAppInstalled))] isReachable[(String(describing: session.isReachable))]"); displays: Session:activationDidCompleteWith --> IsPaired[true] isWatchAppInstalled[false] isReachable[false]
1
0
1.2k
Nov ’22
Product.SubscriptionInfo.status(for:) is sometimes empty even though a subscription has been registered
My app calls Product.SubscriptionInfo.status(for:) to get the subscription status when the app starts. Users with multiple Apple IDs have reported that every few days they get an unpurchased status, and when I checked that, the Product.SubscriptionInfo.status(for:) result array was empty. (When the app is restarted, Product.SubscriptionInfo.status(for:) gives the correct result.) StoreKit.Transaction.currentEntitlements, which is executed immediately after Product.SubscriptionInfo.status(for:), seems to be getting the correct result, so I am trying to check the subscription status with this result. Is it a bug that Product.SubscriptionInfo.status(for:) returns an empty result for the purchaser? There is a mismatch between Product.SubscriptionInfo.status(for:) and StoreKit.Transaction.currentEntitlements. Is it possible for a mismatch to occur?  And In such a case, which result should be adopted?
1
0
747
Nov ’22
How much time is AppIntent.perform() method given?
Prior to iOS 16, Intent Handlers in SiriKit only had 10 seconds to complete the request. However, i have not come across any mention of a time limit in the documentation for the new AppIntents framework. My own testing revealed this limit to be somewhere between 20-25 seconds. Does anyone know what the official time limit is to complete a request with the new AppIntents framework?
2
0
1.8k
Nov ’22
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
826
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