Post

Replies

Boosts

Views

Activity

Push Live Activity not showing up
This is in an iOS Simulator running iOS 18.2 I send a start live activity push notification from the Push Notifications Console on icloud.developer.apple.com. When checking the console.log output it seems to receive the message, yet the activity does not appear in the dynamic island. (the app is backgrounded when I test this) Can anyone tell me why it's not showing? Starting the same activity from within the app using Swift code works fine. Here is the console.app output: default 11:01:59.060954+0100 apsd <APSConnectionServer: 0x104207b80; development/com.apple.aps.sessioncore.PushNotifications.dev/liveactivitiesd 0>: Sending push to client. UUID: (null) default 11:01:59.061012+0100 apsd Dispatching high priority message on server: <APSConnectionServer: 0x104207b80; development/com.apple.aps.sessioncore.PushNotifications.dev/liveactivitiesd 0> default 11:01:59.061770+0100 apsd Looking up connection on peer: 4304b50 found <APSConnectionServer: 0x104207b80; development/com.apple.aps.sessioncore.PushNotifications.dev/liveactivitiesd 0> default 11:01:59.062283+0100 liveactivitiesd APSXPCDeliverMessageEvent: Created APSIncomingMessage. UUID: (null) default 11:01:59.062642+0100 liveactivitiesd <APSConnection: 0x600003d18000> Delivering message from apsd: <APSIncomingMessage: 0x600000c2e9a0> 2897852514 com.****.****.push-type.liveactivity default 11:01:59.062763+0100 liveactivitiesd <APSConnection: 0x600003d18000> Delivering message from apsd. UUID: (null) default 11:01:59.063374+0100 liveactivitiesd <APSConnection: 0x600003d18000> making delegate (<SessionPushNotifications.APSPushConnection: 0x600000227460>) calls to deliver message 2897852514 { aps = { alert = { "loc-key" = "recording_started_message"; "title-loc-key" = "recording_started_title"; }; attributes = { isRecording = 1; }; "attributes-type" = SWAutomaticTripRecorderActivityAttributes; "content-state" = { distance = 0; }; event = start; timestamp = 1742374701; }; } for topic com.****.****test.push-type.liveactivity default 11:01:59.063440+0100 liveactivitiesd <APSConnection: 0x600003d18000> calling <SessionPushNotifications.APSPushConnection: 0x600000227460> connection:didReceiveIncomingMessage: default 11:01:59.063740+0100 liveactivitiesd Acquiring keep-alive with reason: Received message default 11:01:59.063785+0100 liveactivitiesd Keep-alive reasons: ["Received message": 1] default 11:01:59.063803+0100 liveactivitiesd <APSConnection: 0x600003d18000> returned from <SessionPushNotifications.APSPushConnection: 0x600000227460> connection:didReceiveIncomingMessage: default 11:01:59.063883+0100 liveactivitiesd <APSConnection: 0x600003d18000> responding with an ack for message with guid E19D7D04-12A0-4F1B-B33C-F6BF57EE2EFF default 11:01:59.063921+0100 liveactivitiesd <APSConnection: 0x600003d18000> responding with an ack. UUID: (null) default 11:01:59.063996+0100 apsd Looking up connection on peer: 4304b50 found <APSConnectionServer: 0x104207b80; development/com.apple.aps.sessioncore.PushNotifications.dev/liveactivitiesd 0> default 11:01:59.064019+0100 apsd <APSUserCourier 0x100f052a0 development 0> informed that <APSConnectionServer: 0x104207b80; development/com.apple.aps.sessioncore.PushNotifications.dev/liveactivitiesd 0> acknowledges incoming message with guid E19D7D04-12A0-4F1B-B33C-F6BF57EE2EFF tracingUUID (null) default 11:01:59.064063+0100 liveactivitiesd Received message: topic: Topic(unsuffixed: "com.****.****test"); channelID: nil; token: Optional(128 bytes); eventType: start(SessionPushNotifications.IncomingMessage.EventType.StartParameters(attributesType: "SWAutomaticTripRecorderActivityAttributes", attributesData: 20 bytes, inputs: [])) for environment: development default 11:01:59.064198+0100 liveactivitiesd Received push event for com.****.****test::pushToStart default 11:01:59.064232+0100 liveactivitiesd Adding push-to-start budget for com.****.****test::pushToStart default 11:01:59.064273+0100 liveactivitiesd Acquiring keep-alive with reason: Database default 11:01:59.064296+0100 liveactivitiesd Keep-alive reasons: ["Database": 1, "Received message": 1] default 11:01:59.064313+0100 liveactivitiesd Acquiring keep-alive with reason: Database default 11:01:59.064330+0100 liveactivitiesd Keep-alive reasons: ["Database": 2, "Received message": 1] default 11:01:59.064342+0100 liveactivitiesd Reduced budget for com.****.****test::pushToStart to: 9 default 11:01:59.064358+0100 liveactivitiesd Topic com.****.****test.push-type.liveactivity has remaining budget for pushToStart of 9 default 11:01:59.064369+0100 liveactivitiesd Topic com.****.****test.push-type.liveactivity has not used any budget for activity default 11:01:59.064436+0100 liveactivitiesd Scheduling wake to re-evaluate push subscription budgets at 2025-03-19 11:01:59 +0000 default 11:01:59.064547+0100 liveactivitiesd Earliest nonwaking date from task "Push server budget timeout expiration": 2025-03-19T12:01:59+01:00, finalWakeTarget: 2025-03-19T12:01:59+01:00 3599.999696 default 11:01:59.064593+0100 liveactivitiesd Earliest waking date from task "Push server budget timeout expiration": 2025-03-19T12:01:59+01:00, finalWakeTarget: 2025-03-19T12:01:59+01:00 3599.999651 default 11:01:59.064620+0100 liveactivitiesd Scheduling nonwaking task for: 2025-03-19T12:01:59+01:00 in 3599.999622s default 11:01:59.064659+0100 liveactivitiesd Scheduling waking task for: 2025-03-19T12:01:59+01:00 in 3599.999584s default 11:01:59.064671+0100 liveactivitiesd Acquiring keep-alive with reason: wake scheduling default 11:01:59.064692+0100 liveactivitiesd Keep-alive reasons: ["Database": 2, "Received message": 1, "wake scheduling": 1] default 11:01:59.064734+0100 liveactivitiesd Scheduling waking task for adjusted date: 2025-03-19T12:01:59+01:00 in 3599.999508s default 11:01:59.064768+0100 liveactivitiesd xpc_activity_register: com.apple.sessionkit.wake, criteria: dictionary default 11:01:59.064843+0100 liveactivitiesd Received pushToStart notification for com.****.****test::pushToStart default 11:01:59.064955+0100 liveactivitiesd Keep-alive reasons: ["Database": 2, "Received message": 1] default 11:01:59.064979+0100 liveactivitiesd Publishing event: timestamp: 2025-03-19 08:58:21 +0000; activityIdentifier: F432AB2F-1799-4437-B54B-6D9D70A0B260; eventType: start(SessionPushNotifications.PushEvent.EventType.ActivityStartParameters(attributesType: "SWAutomaticTripRecorderActivityAttributes", attributesData: 20 bytes, contentSourceRequests: [ActivityKit.ActivityContentSource.Request.push(request: ActivityKit.PushActivityContentSource.Request.push, target: ProcessDescriptor.Request("com.****.****test")), ActivityKit.ActivityContentSource.Request.process(target: ProcessDescriptor.Request("com.****.****test"))]))
1
0
61
Mar ’25
MapKit not working in Swift Playgrounds
This is the complete Playground code: import MapKit import SwiftUI import PlaygroundSupport struct AddressSearchView: View { @State private var region = MKCoordinateRegion( center: CLLocationCoordinate2D(latitude: 37.7749, longitude: -122.4194), span: MKCoordinateSpan(latitudeDelta: 0.01, longitudeDelta: 0.01) ) var body: some View { VStack { Map(position: .constant(MapCameraPosition.region(region))) { } .frame(height: 300) } } } struct AddressSearchView_Previews: PreviewProvider { static var previews: some View { AddressSearchView() } } PlaygroundPage.current.setLiveView(AddressSearchView()) When I try to run this I get this in the debug console: error: Couldn't look up symbols: protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI Hint: The expression tried to call a function that is not present in the target, perhaps because it was optimized out by the compiler. the preview never shows up. If I use other SwiftUI components and not the map it works fine. What is happening? Playground target is Swift 6 macOS (iOS does the same). Xcode 16.2
0
0
182
Mar ’25
VNDocumentCameraViewController not working on macOS
I have an iPad app that I want to run on Apple Silicon macs. Everything works fine except for VNDocumentCameraViewController. According to the docs this class is available on: iOS 13.0+ iPadOS 13.0+ Mac Catalyst 13.1+ visionOS 1.0+ yet when I try using it I get Document camera is not available on my Mac Studio running macOS 15.2 Is this expected behaviour? Thanks
0
0
325
Jan ’25
SecKeyCreateRandomKey with EC key type generates broken keypair
Why does the following code generate a public key that can't be parsed by openssl? import Security import CryptoKit func generateKeys() throws -> (privateKey: SecKey, publicKey: SecKey) { let query: [String: Any] = [ kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom, kSecAttrKeySizeInBits as String: 256, kSecAttrIsPermanent as String: false ] var error: Unmanaged<CFError>? guard let privateKey = SecKeyCreateRandomKey(query as CFDictionary, &error) else { throw error!.takeRetainedValue() } let publicKey = SecKeyCopyPublicKey(privateKey)! return (privateKey, publicKey) } extension SecKey { func exportBase64EncodedKey() -> String { var error: Unmanaged<CFError>? guard let data = SecKeyCopyExternalRepresentation(self, &error) else { fatalError("Failed to export key: \(error!.takeRetainedValue())") } return (data as Data).base64EncodedString(options: [.lineLength64Characters]) } } func printPublicKey() { let keyPair = try! generateKeys() let encodedPublicKey = keyPair.publicKey.exportBase64EncodedKey() var header = "-----BEGIN PUBLIC KEY-----" var footer = "-----END PUBLIC KEY-----" var pemKey = "\(header)\n\(encodedPublicKey)\n\(footer)\n" print(pemKey) } printPublicKey() when parsing the key I get this: openssl pkey -pubin -in new_public_key.pem -text -noout Could not find private key of Public Key from new_public_key.pem 404278EC01000000:error:1E08010C:DECODER routines:OSSL_DECODER_from_bio:unsupported:crypto/encode_decode/decoder_lib.c:102:No supported data to decode. Replacing kSecAttrKeyTypeECSECPrimeRandom with kSecAttrKeyTypeRSA and a bigger key size (e.g. 2048) gives me a working public key that can be parsed by Openssl. Thanks!
1
0
545
Jan ’25
Strings catalog not removing unused strings
I have some formatting strings that got in my string catalog, e.g. "%@" or "(%@)". However these strings are no longer used in my code anywhere (searching "In this project" in Xcode only matches the entries in my strings catalog), but Xcode does not remove them. I tried editing the file in a text editor, removing them manually but they keep coming back. Any solution for this? Xcode Version 15.4 (15F31d)
1
1
445
Sep ’24
requestWhenInUseAuthorization never shows dialog on watchos
I have a combined iOS + WatchOS app that has worked fine on iOS 16 and WatchOS 9, but on iOS17 / WatchOS 10 I have location permission issues. As you can tell from the previous sentence, all plist entries are set and asking for location updates when the app is in foreground worked fine on the watch on WatchOS 9, however since switching to Xcode 15 things have stopped working. What happens now is: I call locationManager.requestWhenInUseAuthorization() on the watch, which doesn't do anything. I do not get the popup asking for location permissions and none of the delegate methods are called on locationManager. However as soon as I do the same call on my iOS app I get the popup on my phone and immediately the delegate is called in my watch app. So right now the only way of getting location permissions from the user is inside the iOS app, not the watch app. Has anyone else encountered this? Is there a solution?
2
0
1.1k
Sep ’23
Storekit sandbox accounts generating errors on device
Xcode 14.2 iOS 16.0.2 I am running my app through Xcode on my iPhone 13 Pro. Some time ago I have used some Sandbox test accounts to do in apps purchases. It seems that those purchases generate errors now for some unknown reason, and considering the error code I don't think it's on my side: When starting my app I start listening for transactions through:      return Task.detached {       for await verificationResult in Transaction.updates { A bit after starting this I see the following error several times in the log output: [Default] Error enumerating all current transactions: Error Domain=ASDErrorDomain Code=500 "Unhandled exception" UserInfo={NSUnderlyingError=0x28156b630 {Error Domain=AMSErrorDomain Code=2 "Finance Authentication Error" UserInfo={NSLocalizedDescription=Finance Authentication Error, AMSURL=https://mzstorekit-sb.itunes.apple.com/inApps/v1/history?guid=00008110-001414803EA2801E&reason=initial, AMSStatusCode=401, NSLocalizedFailureReason=No delegate to perform authentication: <AMSAuthenticateRequest: 0x100e43920> {  account = ***@******.be (9A040C11-C4A6-4D23-A7A2-450F363B8751),  logKey = 789580B8,  options = <AMSAuthenticateOptions: 0x100e4f910> {  AMSAuthenticateOptionsAllowPasswordGeneration = 0,  AMSAuthenticateOptionsAllowSecondaryCredentialSource = 0,  AMSAuthenticateOptionsAllowServerDialogs = 0,  AMSAuthenticateOptionsAuthenticationTypeKey = 1,  AMSAuthenticateOptionsCanMakeAccountActiveKey = 0,  AMSAuthenticateOptionsClientInfo = {length = 823, bytes = 0x62706c69 73743030 d4010203 04050607 ... 00000000 0000029d },  AMSAuthenticateOptionsCredentialSourceKey = 0,  AMSAuthenticateOptionsDebugReason = no dialogResponse in AMSFinanceAuthenticateResponse,  AMSAuthenticateOptionsEnableAccountCreationKey = 0,  AMSAuthenticateOptionsEphemeralKey = 0,  AMSAuthenticateOptionsForceSyncToPairedWatchKey = 0,  AMSAuthenticateOptionsIgnoreAccountConversion = 0,  AMSAuthenticateOptionsLogKeyKey = 789580B8,  AMSAuthenticateOptionsRemoteProxyAuthenticationKey = 0,  AMSAuthenticateOptionsServiceType = 2, }, }}}, storefront-country-code=BEL, client-environment-type=Sandbox, NSLocalizedFailureReason=An unknown error occurred, NSLocalizedDescription=Unhandled exception} What is going on and how can I get rid of those errors?
3
1
3.2k
Jan ’23
Xcode 14 how to add complications to an existing WatchOS project?
The documentation here: https://developer.apple.com/documentation/clockkit/creating_complications_for_your_watchos_app/enabling_complications_for_your_watchos_app Is completely outdated and I find zero documentation on how to add complications to an existing WatchOS project. The "Extension" no longer exists, and the settings in the target no longer exist either.
2
0
1.1k
Sep ’22
XCode 14 Beta 6 Watch Simulator installation error
Just installed Xcode 14 Beta 6. Clicked to install the WatchOS9 simulator. I got the following error at the end of the download: Duplicate of E50E35E0-4EEC-411C-80EB-FA454D352F42 Domain: SimDiskImageErrorDomain Code: 5 User Info: {   DVTErrorCreationDateKey = "2022-08-24 15:37:31 +0000";   unusableErrorDetail = ""; } -- System Information macOS Version 12.4 (Build 21F79) Xcode 14.0 (21330) (Build 14A5294g) Timestamp: 2022-08-24T17:37:31+02:00
3
1
1.6k
Aug ’22
iOS 16 Beta 6 Testflight not installing apps
We built a standalone WatchOS app with Xcode 14 beta 5 and uploaded it to Testflight. Minimum WatchOS version is 8 Installing it through an iPhone with iOS 15 is no problem. Installing it through an iPhone with iOS 16 Beta 6 does not work. We get the circle progress indicator but it doesn't move. When I look in the Console app and check for Testflight logs I see this: Error getting application record with bundle ID com.---.---.watch.watchkitapp: The operation couldn’t be completed. (OSStatus error -10814.) Any idea what's going on?
0
0
774
Aug ’22
WatchOS9 Beta 6 symbols not downloaded in Xcode 14 Beta 5
I have an iPhone 11 running iOS 16 beta 6, and a paired Apple Watch SE 40mm running WatchOS9 beta 6. When connecting to the computer, Xcode downloads the symbols of the iPhone, but not of the paired watch, and inside Xcode I can't select my watch as run target because "there was an error downloading its symbols". I tried rebooting both the watch and the phone several times, and restarting Xcode. Nothing helps I see in Finder the symbols for my phone, but the folder that's supposed to contain those for my watch is there but it has no contents. This is blocking as I can't test my WatchOS app for WatchOS9 because of this.
2
0
726
Aug ’22
Storekit2 equivalent of SKPaymentTransactionObserver
We have implementend Storekit 2 in our app, for one time purchases and subscriptions, so it is iOS15 and higher only. Everything works fine, but now we want to add App Store promotions for our IAP's. That doesn't work because the App requires the app to implement SKPaymentTransactionObserver How to Promote Your In-App Purchases Make sure your app supports a delegate method in SKPaymentTransactionObserver. You can choose to customize which promoted in-app purchases a user sees on a specific device by implementing SKProductStorePromotionController. The problem is that this observer is part of the original Storekit API and not of the new one. What can we do to make this work with the new Storekit 2 API?
3
0
2.1k
May ’22