I'm working on a demonstration iOS project with no code other than the default templates that Xcode provided. I'm using the latest Xcode v15.3. In storyboard I've added 2 views to the default View Controller to which I've added constraints such that by default, the first one takes up the top half of the screen and the second one roughly the remainder (bottom half of the screen). Then I've added additional constraints for a "landscape" view, i.e. using the width=regular, height=compact such that the first view takes up the left half of the screen and the second view roughly the remaining right side. In the property inspector I've toggled the "Installed" checkboxes so that the correct constraints are applied for each size class.
Both portrait and landscape views look correct in the storyboard editor, and Xcode reports no warnings.
But when I run Simulator and rotate left to landscape mode, it's not applying the wR:hC size class, and I get a "wide" format as if I hadn't added any additional constraints at all.
Is there some reason why Simulator isn't applying the correct constraints when the device gets rotated? Is this an Xcode bug or did I do something wrong? I've attached a few screen grabs from storyboard and the simulator. You can see which constraints are which based on the icon color in storyboard's document outline pane.
Post not yet marked as solved
Hi, community:
I was trying to move from application(_:open:options:) (UIKit) to
onOpenURL(perform:) (SwiftUI). Maybe there's something that I'm missing.
In UIKit you can say to the system that you won't handle the URL then the app is not opened, but when I use onOpenURL(perform:) it is always opened. Is there any way to achieve the same behavior?
Thanks in advance.
We generate key pair and import cert with access flag kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly in our application. We then have notification extension that access shared keychain to retrieve the identity when device is locked.
We use SecItemCopyMatching to get all SecIdentity with its attributes as below:
let queryDict: [String: Any] = [
kSecClass as String: kSecClassIdentity,
kSecReturnAttributes as String: true,
kSecReturnRef as String: true,
kSecMatchLimit as String: kSecMatchLimitAll
]
var oss = SecItemCopyMatching(queryDict as CFDictionary, &attrs)
When the code runs on notification extension with locked device, it failed on some devices (not on all devices) with error -25308. The sysdiagnose shows:
default securityd 2024-03-14 10:49:13.844996 -0400 129 0x110115 SecDbKeychainItemV7: cannot decrypt metadata key because the keychain is locked (-25308)
default securityd 2024-03-14 10:49:13.845036 -0400 129 0x110091 NSExtension[2222]/1#7 LF=0 copy_matching Error Domain=NSOSStatusErrorDomain Code=-25308 "ks_crypt: e00002e2 failed to 'od' item (class 6, bag: 0) Access to item attempted while keychain is locked." UserInfo={numberOfErrorsDeep=0, NSDescription=ks_crypt: e00002e2 failed to 'od' item (class 6, bag: 0) Access to item attempted while keychain is locked.}
We also try to use access flag kSecAttrAccessibleAlwaysThisDeviceOnly, but it doesn't make difference. Since securityd reports "cannot decrypt metadata key because keychain is locked". I wonder if it is because we query attributes for all identity. Is it a bug on Security framework?
Thanks,
Ying
Post not yet marked as solved
With the latest release of Xcode, my obj c++ project is now giving compile errors like this.
No code has changed. Reverting to Xcode 15.2 solves this
Post not yet marked as solved
Dear Apple support,
We are working on one of the projects related to BLE, in which our BLE device is acting as a GATT client and my iPhone device (iPhone 13, 17.3) is acting as a GATT server.
Issue being faced: Whenever my BLE device subscribes to the ANCS notifications, and the moment the IOS device starts bombarding with the notifications available in notification center, the BLE device controller's heap memory becomes UNAVAILABLE in runtime for this notifications' queue and eventually making the BLE controller to reset. Thereafter, whenever user tries making a new connection session of BLE, again same thing repeats.
Notifications allowed : W-SMS, W-CALL, SMS, CALL, none other than this.
Issue observed with : 150 notifications and above available in notification center, otherwise our product works fine with iPhone.
We would like to know how we can curb the number of PRE-EXISTING type notifications available in the notification center flowing towards the BLE device?
What best solution can be done at the IOS side, we also have IOS APP team for this project.
What kind of APIs does Core Bluetooth framework can provide to the IOS developer in order to overcome this issue.
Please suggest possible ways from the IPHONE device only to overcome this. BLE's software CANNOT BE CHANGED under any circumstances as the product is already in production and complaints are coming from end user (from the field).
OUR GOAL : ONLY notifications which will be available in run time, i.e. AFTER SUCCESSFUL BLE connection established to be displayed in the BLE's display. We DON'T WANT older notifications to be displayed and flow towards BLE over ANCS.
WE MUST make 'notification popup' option as ALLOW to be shared with our BLE device, otherwise SMS,CALL, W-SMS,W-CALL during live connection will not come on the BLE 's display.
Post not yet marked as solved
Hi!
Recently our app had a strange crash. It's about PHPhotoLibrary. We can't reproduce it. And we can sure the user has authorized the album. It has been troubling us for a month.
Has anyone encountered similar problems?
Exception: Access to the photo library is not allowed until the photo library is obtainable.
Here is the crash stack.
Stack trace:
Fatal Exception: NSInternalInconsistencyException
0 CoreFoundation 0xecb28 __exceptionPreprocess
1 libobjc.A.dylib 0x2af78 objc_exception_throw
2 PhotoLibraryServices 0x60d6c -[PLPhotoLibrary loadDatabaseWithOptions:error:]
3 PhotoLibraryServices 0x64dec +[PLPhotoLibrary newPhotoLibraryWithName:loadedFromBundle:options:error:]
4 Photos 0xf2810 newPhotoLibrary
5 Photos 0xf2328 __50-[PHPhotoLibrary initWithPhotoLibraryBundle:type:]_block_invoke_4
6 PhotoLibraryServicesCore 0x446c __27-[PLLazyObject objectValue]block_invoke
7 PhotoLibraryServicesCore 0x43e0 PLResultWithUnfairLock
8 PhotoLibraryServicesCore 0x4388 -[PLLazyObject objectValue]
9 Photos 0xf092c -[PHPhotoLibrary backgroundQueuePhotoLibrary]
10 Photos 0xf0830 -[PHPhotoLibrary photoLibraryForCurrentQueueQoS]
11 Photos 0xf72bc -[PHPhotoLibrary(PXCPLStatus) managedObjectContextForCurrentQueueQoS]
12 Photos 0x17d800 -[PHQuery createFetchRequestIncludingBasePredicate:]
13 Photos 0x17d37c -[PHQuery fetchRequest]
14 Photos 0x1fb2fc -[PHFetchResult initWithQuery:oids:registerIfNeeded:usingManagedObjectContext:]
15 Photos 0x1fb16c -[PHFetchResult initWithQuery:]
16 Photos 0x17bc8c __23-[PHQuery executeQuery]block_invoke
17 Photos 0x17ee74 PHQueryForAssetCollectionType_Album_block_invoke_97
18 Photos 0x17bb98 -[PHQuery executeQuery]
19 Photos 0x3a744 __67+[PHAssetCollection fetchAssetCollectionsWithType:subtype:options:]block_invoke
20 Photos 0x1704e4 +[PHObject authorizationAwareFetchResultWithOptions:fetchBlock:]
21 Photos 0x3a69c +[PHAssetCollection fetchAssetCollectionsWithType:subtype:options:]
22 INSBusinessServices 0x46b994 PHPhotoLibrary.fetchAlbums(withName:) + 391 (PHPhotoLibrary+Custom.swift:391)
23 Insta360 ONE R 0x5008ac closure #1 in Album.loadMediasAtSystemAlbum(notNeedTypeIsVideo:) + 122 (Album+Assets.swift:122)
24 ReactiveSwift 0x19b70 closure #1 in SignalProducer.init(:) + 112 (SignalProducer.swift:112)
25 ReactiveSwift 0x2da50 partial apply for closure #1 in GeneratorCore.makeInstance() + 433 (SignalProducer.swift:433)
26 ReactiveSwift 0x192d8 SignalProducer.startWithSignal(:) + 227 (SignalProducer.swift:227)
27 ReactiveSwift 0x2eb14 partial apply for closure #1 in closure #1 in SignalProducer.start(on:) + 2045 (SignalProducer.swift:2045)
28 INSFoundationKit 0xe5010 partial apply for closure #1 in GCDGloabalScheduler.schedule(:) + 19 (GCDAide.swift:19)
29 INSFoundationKit 0xe50c4 partial apply for closure #1 in static GCDAide.asyncOnGlobal(after::)
30 INSFoundationKit 0x25338 thunk for @escaping @callee_guaranteed () -> ()
31 libdispatch.dylib 0x213c _dispatch_call_block_and_release
32 libdispatch.dylib 0x3dd4 _dispatch_client_callout
33 libdispatch.dylib 0x72d8 _dispatch_continuation_pop
34 libdispatch.dylib 0x68f4 _dispatch_async_redirect_invoke
35 libdispatch.dylib 0x15894 _dispatch_root_queue_drain
36 libdispatch.dylib 0x1609c _dispatch_worker_thread2
37 libsystem_pthread.dylib 0x1ee4 _pthread_wqthread
38 libsystem_pthread.dylib 0x1fc0 start_wqthread
Post not yet marked as solved
Dears, do we have to expect any alert from Apple during upload to appcenter for new clients in order to be compliant to Third Party SDK and signature? I'm uploading new beta clients every day without any evidence (rather than the Xcode 15 one)
Could someone notify if receiving any alert during upload step or can we have any alert during manual review?
It's not clear to me if i have to work on it or what.
Thanks
Post not yet marked as solved
Hi! I'm working on an iOS Safari extension that has a ServiceWorker. Lately we've noticed that this ServiceWorker seems to get killed seemingly at random, and there are no logs or crash reports to tell us what happened.
I'm hypothesizing that iOS might be shutting down Safari ServiceWorkers when the ProcessInfo.thermalState approaches .serious. I have circumstantial evidence that our ServiceWorker tends to get killed more often at higher levels of thermalState but can't yet say conclusively that this is the case. I can't find any direct evidence of this on internet searches either.
Is anyone able to shed light onto this topic? The specific symptoms are:
ServiceWorker stops, and the menu entry for its console window no longer appears on macOS Safari.
No crash logs via Xcode or Sentry, and no Console messages as far as we could tell (caveat: MobileSafari generates a LOT of messages! We might have missed it.)
If attached via debugger, the native part of our extension just disappears and the debugger loses connection with no error message.
ServiceWorker no longer works for the lifetime of the Safari process. Sometimes, when we kill Safari and restart, we can get the ServiceWorker back. This usually requires toggling our extension's "enabled" state in system settings.
In some cases, even killing/relaunching Safari and toggling the system setting doesn't bring our ServiceWorker back. I'm hypothesizing right now that this happens when the thermal state is high.
I've tried simulating a serious/critical thermal state in the Xcode Devices window, but couldn't repro the ServiceWorker problem. I don't know if that setting affects the whole system, though, or just our own apps.
Help appreciated!
Yuna
Post not yet marked as solved
Hi,
An existing app on AppStore have issue with SHA256 Hash only since iOS17.4.
And only Pro and Pro Max seems affected by this issue.
NSData is read from downloaded file.
Hash is calculated with
unsigned char *CC_SHA256(const void *data, CC_LONG len, unsigned char *md)
And compared with original HASH
It appears different only on iOS17.4 and only Pro and Pro Max.
But i can't reproduce this issue.
Do you have an idea ?
Thank you
Post not yet marked as solved
Upgrade phone, then watch was paired to the new phone with developer mode enabled, but developer mode on watch is no longer visible on watchOS 10.4
Post not yet marked as solved
We have developed a Bluetooth external Braille display and want to have it added to
to the list of Braille displays supported by VoiceOver:
https://support.apple.com/en-gb/103246
How should we proceed?
Thank you.
Post not yet marked as solved
Hello, Apple.
I'm not sure here is right place that I ask about, but I strongly want to appeal this question.
Since update IOS 17, changing a background showed "background expansion," which makes pictures on top be blurred, again.
I was happy that when IOS 16 updated, that feature was gone for a while, so it was easy to move and adjust picture as I want.
BUT, this expansion feature came back again on IOS 17, and it made me so stressful to adjust size or place of picture.
Can you please be able to remove this feature or make people can choose the feature what they want from setting?
I really want to use previous feature again than newest feature.
Thanks.
Post not yet marked as solved
Hello,
during development of a simple game for iPhone and iPad, I'm using a Swift package to keep track of app launches — this does not collect any user-related information. Only the device model, iOS version and build version number are reported by the package, which automatically also includes the originating IP address.
While looking at the Swift package reports, I'm seeing a few unexpected entries:
launches from devices that do not belong to any testers (established by looking at the device models)
launches from builds that have been expired in App Store Connect
launches from IP addresses apparently from the Apple WAN (established by looking up the addresses via e.g. whois)
A single public link to a TestFlight build was shared with a single group of testers — none of which have the device models described above in 1. This link has been expired as soon as I noticed the unexpected entries.
But the entries keep coming, and they mostly coincide with new TestFlight builds — although the launches do not come from the new builds, but rather from older ones.
Has anyone experienced something similar with TestFlight builds...?
Thank you,
D.
Post not yet marked as solved
I re-posted to fix format issues as neither edit nor remove seems to work. However I am not able to delete this post.
Please check the latest version of this post with the same title and also posted by playbrainiacs. Thanks.
Post not yet marked as solved
I need clarification on the GKLocalPlayer.local.isMultiplayerGamingRestricted behavior which check's user's device capability (whether it is set up to allow or disallow multiplayer)
I am referring to this from Apple documentation at :
https://developer.apple.com/documentation/gamekit/authenticating_a_player if GKLocalPlayer.local.isMultiplayerGamingRestricted { // Disable multiplayer game features. }
The issue is that this is a boolean (true/false value )
However I have noticed that iOS ( latest version and preceding versions) allow people to have the following options: ( you can set these under screen time -> content restrictions -> Multiplayer games )
Disallow all multiplayer games - presumably your API returns a false for
this.
Allow multiplayer with friends only -???? what does GKLocalPlayer.local.isMultiplayerGamingRestricted return here?? if True, how is the Friends only restriction handled? Are we supposed to do something to force it? Note: So far I am relying on Apple's Game Center native experience and have not added wrappers to do additional filtering etc. I hope that I shall be able to keep doing so.
Allow all multiplayer games - presumably your API returns a false for
this.
You can see how there are three choices but this is modeled as a boolean.
Choice number 2. is not addressed.
Has anyone come across this?
Note: This is very different from checking for underage users.
No matter what I do, in my post above, it won't set the correct numbers for numbered bullet -points. I call them 1, 2, 3 it posts 1,1,2 or 1.,2,1 etc. ( side nit ) Apologies if this isn't as readable as it should be.
Post not yet marked as solved
Hello, maybe anyone know anything about HCE (Host card emulation) feature on iOS?
As far as I read, it's not possible to achieve this functionality on iOS, but maybe there are plans to implement that? Or maybe it's clear that it wont be allowed to be used at all? Thanks:)
Are there any drawbacks (e.g. slower request) by setting assumesHTTP3Capable to true if the server doesn't support it? Is it OK to set it globally in the app for all URLRequests or it should be set depending on to which server the app makes the request? Thanks!
Post not yet marked as solved
Hi, we are currently implementing below method for a quick POC in iOS (Xcode 15.3/macOS Sonoma 14.0):
func startQUICConnection() async {
// Set the initial stream to bidirectional.
options.direction = .bidirectional
self.mainConn?.stateUpdateHandler = { [weak self] state in
print("Main Connection State: \(state)")
switch state {
case .ready:
print("Ready...")
default:
break
}
}
// Don't forget to start the connection.
self.mainConn?.start(queue: self.queue)
}
This is what we have in the initializer of the class:
parameters = NWParameters(quic: options)
mainConn = NWConnection(to: endpoint, using: parameters)
These are the class's properties:
let endpoint = NWEndpoint.hostPort(host: "0.0.0.0", port: .init(integerLiteral: 6667))
let options = NWProtocolQUIC.Options(alpn: ["echo"])
let queue = DispatchQueue(label: "quic", qos: .userInteractive)
var mainConn: NWConnection? = nil
let parameters: NWParameters!
As per the logs, we never get to the .ready state for the NWConnection.
Logs:
nw_path_evaluator_create_flow_inner failed NECP_CLIENT_ACTION_ADD_FLOW (null) evaluator parameters: quic, attach protocol listener, attribution: developer, context: Default Network Context (private), proc: 022B7C28-0271-3628-8E5E-26B590B50E5B
nw_path_evaluator_create_flow_inner NECP_CLIENT_ACTION_ADD_FLOW 8FEBF750-979D-437F-B4A8-FB71F4C5A882 [22: Invalid argument]
nw_endpoint_flow_setup_channel [C2 0.0.0.0:6667 in_progress channel-flow (satisfied (Path is satisfied), interface: en0[802.11], ipv4, ipv6, dns, uses wifi)] failed to request add nexus flow
Main Connection State: preparing
Main Connection State: waiting(POSIXErrorCode(rawValue: 22): Invalid argument)
We're running a local server using proxygen on port 6667. It connects with the proxygen client though...
Have tried several thing but results are the same.
Post not yet marked as solved
I have already raised a ticket with Apple Support, till date not received any response.
Ticket ID#: 102242932873 102238105199
Any help would be appreciated, as we are awaiting response. Is there any other way to reach the support team?
We are awaiting response since last 2 weeks.
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unsupported object <CPActionSheetTemplate: 0x2819a4480> <identifier: CD077C44-7F3F-46CC-B713-35A0259124EA, userInfo: (null), tabTitle: (null), tabImage: (null), showsTabBadge: 0> passed to presentTemplate:animated:completion:. Allowed classes: {(
CPAlertTemplate,
CPVoiceControlTemplate,
CPGridTemplate,
CPListTemplate,
CPNowPlayingTemplate,
CPTabBarTemplate
)}'
[[NMCarPlayEventManage shareManage].carplayInterfaceController dismissTemplateAnimated:NO];
[[NMCarPlayEventManage shareManage].carplayInterfaceController presentTemplate:sp animated:YES];