iOS is the operating system for iPhone.

iOS Documentation

Posts under iOS tag

2,693 Posts
Sort by:
Post not yet marked as solved
6 Replies
568 Views
I'm new to Networking, so forgive me if this is a silly question: In the sample code, Building a custom peer-to-peer protocol, TLS is configured as follows: // Create TLS options using a passcode to derive a pre-shared key. private static func tlsOptions(passcode: String) -> NWProtocolTLS.Options { let tlsOptions = NWProtocolTLS.Options() let authenticationKey = SymmetricKey(data: passcode.data(using: .utf8)!) var authenticationCode = HMAC<SHA256>.authenticationCode(for: "TicTacToe".data(using: .utf8)!, using: authenticationKey) let authenticationDispatchData = withUnsafeBytes(of: &authenticationCode) { (ptr: UnsafeRawBufferPointer) in DispatchData(bytes: ptr) } sec_protocol_options_add_pre_shared_key(tlsOptions.securityProtocolOptions, authenticationDispatchData as __DispatchData, stringToDispatchData("TicTacToe")! as __DispatchData) sec_protocol_options_append_tls_ciphersuite(tlsOptions.securityProtocolOptions, tls_ciphersuite_t(rawValue: TLS_PSK_WITH_AES_128_GCM_SHA256)!) return tlsOptions } The sample code touts the connection as secure ("...uses Bonjour and TLS to establish secure connections between nearby devices"), but to my untrained eye it doesn't seem so. My reasoning is as follows: If I adapt this code as-is, so connections between two instances of my app use SymmetricKeys derived from the four-digit passcode, then wouldn't my encryption be easy to break by an adversary who sends 0000...9999 and records corresponding changes in the encryption, exposing my app to all sorts of attacks? The sample uses the passcode to validate the connection (host user shows client user the passcode, which is manually entered), which is a feature I would like to keep in some form or another, which is why this is causing so many headaches. Generally speaking, is there a way to secure a local peer-to-peer connection over Network.framework that doesn't involve certificates? If certificates are the only way, are there good resources you can recommend?
Posted
by wmk.
Last updated
.
Post not yet marked as solved
3 Replies
647 Views
I recently encountered a difficult-to-diagnose bug in an app that I'm working on, and I thought I would share it with the Apple Developer community. The app that I'm working on is an iOS app that uses Core Location's Visit Monitoring API, and it is essential that the app is able to process incoming visits while running in the background. However, after real-world testing, I discovered several crash reports which were difficult to understand, as SwiftUI symbols are not symbolicated on debug builds. Eventually I discovered that the app was crashing when calling an @EnvironmentObject property of the root ContentView from that view's body when the app was launched directly into the background from not running at all. After creating a small test app to isolate the problem, I discovered that any environment object declared in the App struct and referenced from the root ContentView causes the crash, with the exception message: "Fatal error: No ObservableObject of type ArbitraryEnvObject found. A View.environmentObject(_:) for ArbitraryEnvObject may be missing as an ancestor of this view." It seems that when a SwiftUI app is launched in the background, the ContentView's body is executed, but the environment is not initialized. I searched through as much documentation as I could, but could not find any information about how this should be handled, so I think it's a bug in SwiftUI. I have filed a Feedback Assistant bug report. The current workaround is to convert my ObservableObject into an object that conforms to the new @Observable protocol, add it to the scene as an Environment Value with the .environment(_:) modifier rather than the .environmentObject(_:) modifier, and declare the @Environment property on the view as optional. The object will still be missing when the app is launched in the background, but the optional property can be handled safely to prevent a crash. Attached to this post is a sample project that demonstrates the issue and the workaround. And finally, I'd like to hear from anyone who knows more about the expected behavior of background launches of SwiftUI apps, and whether or not there's something I should be doing completely differently. I'm not able to directly attach a zip archive to this post, so here's an iCloud link to the sample project: BackgroundEnvObjCrash.zip
Posted Last updated
.
Post not yet marked as solved
0 Replies
66 Views
I'm experiencing an issue with WKWebView and localStorage. I've set up a standard WKWebView with the configuration: configuration.websiteDataStore = WKWebsiteDataStore.default() Everything works fine in the emulator (iOS 16.x, 17.0), but on my iPhone 13 running iOS 17.4, I encounter a problem. When I set a localStorage value on my local HTML page, navigate to another URL within the webview, and then return to the original page, the localStorage is cleared. This behavior is new and wasn't happening before. Has anyone else encountered this or have any suggestions on how to fix it? The localstorage should be persistent as it always has been.
Posted
by AvadheshB.
Last updated
.
Post not yet marked as solved
0 Replies
45 Views
Hello, We're developing a framework that needs to talk to a camera on iOS. We've written a Driverkit Extension to enable this but we're having trouble working out how to distribute this to third parties. We have to specify the application's bundle id in the driverkit's bundle ID. But as far as I can tell that means if there are multiple consumers, they each need their own specially built driverkit extension. For MacOS, we can see an entitlement that allow any 'user client' to connect to our driverkit extension. But from what I can tell, that doesn't seem to be the same for iOS. Am I missing something? Or is it expected that we should have to build a new driverkit extension with a different bundle ID for every app that every third party wants to develop? Let me know if I'm missing too much context, thanks in advance!
Posted Last updated
.
Post not yet marked as solved
6 Replies
755 Views
Hi, With iOS-17.4 update, we are seeing AppProxy VPN not getting started when Apps (associated with PerAppVPN) tried to access network resource after MDM PerAppVPN profile install/update. Looks like PerApp rules associated with applayer vpn profile are broken after profile update/install as we see internet sites working without going through VPN (appProxy network extension), this start working if we toggle WiFi and then access network resource from Apps associated with PerAppVPN. Created FB13688086 with all the details for this iOS 17.4 and AppLayerVPN, looking for and update here and any feedback/pointers will help. Thanks
Posted
by vmku.
Last updated
.
Post not yet marked as solved
0 Replies
43 Views
We are considering raising the age rating of our existing app. Currently, the app is rated 4+, but we are looking into raising it to 12+. We have some questions regarding this change and would appreciate your guidance: For users under 12 years old (below the specified age) who have already installed the app: Will they still be able to use the app as before? Will they be unable to receive updates? For users under 12 years old (below the specified age) accessing the App Store: How will the app appear to them? Will it become invisible in the App Store for them? Thank you for your assistance.
Posted
by Negan_tt.
Last updated
.
Post not yet marked as solved
1 Replies
397 Views
I've been asked to replace Flurry Analytics with Apple's Analytics Framework. I'm referring to runtime reporting of activity within the app itself... ie log event when various views are loaded or when certain buttons are pressed etc. All these log events are then uploaded and available for viewing by the app developer. I've never used or even heard of such a framework from Apple. I see a lot about Apple Analytics as an Appstoreconnect api for gathering sales and marketing data but nothing about the type of analytics i'm looking for. Any information about what is (or is not) available from Apple would be greatly appreciated. Thanks
Posted
by tpmeehan.
Last updated
.
Post not yet marked as solved
0 Replies
65 Views
Hi, When I uploaded 2 videos in the Event Card Video, and Event Details Page Video section of a new In-App Event, both are showing processing for a long time. I'm trying to upload videos for the first time in an in-app event, is it normal to take longer time on video processing? The video dimension is 1920x1080 with 30fps for the event card video, and 1080x1920 with 30fps for the event details page video. Please let me know if you have any tips.
Posted
by sivareena.
Last updated
.
Post not yet marked as solved
1 Replies
97 Views
I have recently submitted a new app version to the Appstore with Xcode 15.0. Unfortunately, I have started to see the below crash in the Xcode organiser &gt; Crashes section occurring for more number of times. UIKitCore: +[UIAlertController _alertControllerContainedInViewController:] + 160 The exception trace is not leading to main() function but not pointing to any of the code line. I had used UIAlertController in the past versions to show the alerts but there is no code written in the current version code related to UIAlertController. Only from the latest version, this kind of crash started to surface. In the latest release, We have added a third party SDK and while implementing the SDK, we had added the Location and Bluetooth Permissions in Info.plist file. But as we don't want to use/track the Location and Bluetooth details from the app, the SDK team has disabled the Location and Bluetooth settings to not reflect in the tracked data. Is this behaviour creating any conflict with the UIAlertController and logging the crash? Because by default the OS tries to show the alert when the permissions exist in the plist file, but the alert will not come as the service is disabled on the SDK server settings. Is this creating any conflict and logging the crash. Please extend your help.
Posted Last updated
.
Post not yet marked as solved
0 Replies
105 Views
Hello, I'm currently integrating a feature in our app that allows customers to set up a passkey. Once set up, users are prompted to use their passkey at the sign-in page. For users without a registered passkey, we ensure that the passkey assertion request fails silently to maintain a smooth login experience, using preferImmediatelyAvailableCredentials effectively for this purpose. However, we've noticed that when users are employing third-party password managers like 1Password or Bitwarden, they encounter a QR code fallback. Discussions with 1Password have revealed that iOS does not currently extend preferImmediatelyAvailableCredentials to these services. I would appreciate any advice on how to harmonize the behavior between iCloud Keychain and third-party password providers to ensure a consistent user experience.
Posted Last updated
.
Post not yet marked as solved
0 Replies
74 Views
Hello, I'm facing an issue with the volume slider in AVPlayer. Despite setting the volume property and mute property to false, the volume slider does not work as expected. Initially, the volume is muted with the slider set to the minimum. If I change the volume, when I release the slider, it returns to the minimum and the mute icon remains active. However, if I set it to maximum, the setting remains and the icon changes. However, the video volume never changes and remains at the value set in the code. Here is the code I am using: var player: AVPlayer! var playerController: AVPlayerViewController! override func viewDidLoad() { super.viewDidLoad() player = AVPlayer(url: URL(fileURLWithPath: Bundle.main.path(forResource: "video", ofType: "mp4")!)) player.volume = 0.5 player.isMuted = false playerController = AVPlayerViewController() playerController.player = player playerController.view.frame = self.view.frame addChild(playerController) view.addSubview(playerController.view) playerController.view.frame = view.bounds playerController.didMove(toParent: self) player.play() } Can someone please help me resolve this issue? Any assistance would be greatly appreciated. Thank you.
Posted
by Luck81.
Last updated
.
Post marked as solved
1 Replies
106 Views
When I run my app in debug mode, whenever a time consuming task is run (like a core data fetch request) there is a time indication appearing on top of the view. I am unable to find the meaning of this and how it is named. It looks like: "appName NNNN ms" (it is not caught by the screen shot) Can someone tell if it is possible to get rid of it and how ? Thanks for your help !
Posted
by SimonWin.
Last updated
.
Post marked as solved
1 Replies
101 Views
Starting on Xcode 15.3 and 15.4 my SwiftUI Previews stopped working with the following error: == PREVIEW UPDATE ERROR:     LinkDylibError: Failed to build ContentView.swift          Linking failed: linker command failed with exit code 1 (use -v to see invocation)          ld: warning: search path '/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator' not found     Undefined symbols for architecture arm64:       "static MyLibrary.DisplayUtil.getText() -> Swift.String", referenced from:           closure #1 () -> SwiftUI.Text in (extension in Demo_Broken_Preview_PreviewReplacement_ContentView_1):Demo_Broken_Preview.ContentView.(__preview__body in _1BA320C8FB5388C953E1E463345C3D72).getter : some in ContentView.1.preview-thunk.o       "type metadata accessor for MyLibrary.DisplayUtil", referenced from:           closure #1 () -> SwiftUI.Text in (extension in Demo_Broken_Preview_PreviewReplacement_ContentView_1):Demo_Broken_Preview.ContentView.(__preview__body in _1BA320C8FB5388C953E1E463345C3D72).getter : some in ContentView.1.preview-thunk.o     ld: symbol(s) not found for architecture arm64     clang: error: linker command failed with exit code 1 (use -v to see invocation) After much trial and error, I narrowed it down to my SwiftUI views using properties or functions inside components in Swift Packages. This is a simple example of my Swift Package: public class DisplayUtil {     public func getText() -> String {         return "Text"     }          public static func getText() -> String {         return "Text"     } } And my SwiftUI View import SwiftUI import MyLibrary struct ContentView: View {     var body: some View {         VStack {             Text(DisplayUtil.getText())         }         .padding()     } } #Preview {     ContentView() } The same code works fine on Xcode 15.2 Link to the sample project: https://www.icloud.com/iclouddrive/0c00AD0esi2PwqqiRggokfwGw#Demo%5FBroken%5FPreview Is anybody else having a similar issue?
Posted
by xlsmearlx.
Last updated
.
Post not yet marked as solved
0 Replies
72 Views
I am developing an iOS app that utilizes the timeInDaylight data from HealthKit. This feature is available starting from iOS 17.0+, but it can only be recorded using the Apple Watch SE (2nd generation) and Apple Watch Series 6 or later. How should I release this app given its dependency on timeInDaylight data? Without this data, the app is useless. I understand that the App Store does not allow setting specific health data requirements. I am also concerned that including a "device requirements" warning in the App Store description might not pass the review process. Could you provide any advice on how to approach this situation? Thank you.
Posted
by gerdemb.
Last updated
.
Post not yet marked as solved
4 Replies
550 Views
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.
Posted
by JesusMG.
Last updated
.
Post marked as solved
2 Replies
142 Views
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unsupported object <CPActionSheetTemplate: 0x600000883720> <identifier: 154853B1-42C9-4A2E-A2AA-8431664FCDC4, userInfo: (null), tabTitle: (null), tabImage: (null), showsTabBadge: 0> passed to presentTemplate:animated:completion:. Allowed classes: {( CPGridTemplate, CPListTemplate, CPNowPlayingTemplate, CPTabBarTemplate, CPAlertTemplate, CPVoiceControlTemplate )} Thanks in advance!
Posted Last updated
.
Post not yet marked as solved
15 Replies
4.6k Views
Xcode 15 and iOS 17.0.2 causing debugging issues when running from Xcode using a cable. When I updated to the new Xcode 15 and device to iOS version to 17.0.2, it is taking a long delay of 1 to 3 minutes to launch the app in the real device. It is also really slow after launching. Every step over or into take almost a minute. I can see the below warning in console "warning: libobjc.A.dylib is being read from process memory. This indicates that LLDB could not find the on-disk shared cache for this device. This will likely reduce debugging performance." I tried with the fix of executing the following command to clear the Device support files rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport. But even after I am facing the same issue. Please do the needful to fix this issue.
Posted
by liavadi.
Last updated
.
Post not yet marked as solved
0 Replies
182 Views
Hello, I want to use universal links in my application, for which I need to get the TeamID and BundleId, for apple-app-site-association file. Can you please tell me, do I have to buy an Apple Developer Account at the time of development to do this, or can I get it all for free at the time of development?
Posted
by qmorozov.
Last updated
.
Post not yet marked as solved
0 Replies
60 Views
iMessage sometimes does not show Firebase Dynamic Link preview, while other apps like Messenger or Slack always work. I don't know if it is because of Firebase or the image itself, as there are some images which do show up in preview and some images don't. If anyone has any clue, please let me know. Thanks!
Posted
by tsuu2092.
Last updated
.