iOS is the operating system for iPhone.

Posts under iOS tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

MediaRecorder stop event is not trigger on safari iOS
I'm trying to record my screen (canvas) on iPad safari with the new experiential media recorder support. I got the mediaRecorder object and it triggers the start event but the issue is whenever mediaRecored record blob it will not trigger the stop event. It is working fine of MAC Safari but on iPad Safari I'm getting this issue. Is there any ways to get the stop event so mediaRecorder fire ondataavailable method after stop on iPad Safari?
3
0
2.0k
Aug ’23
Apple Anonymous Attestation Statement Format
According to the documentation - https://github.com/w3c/webauthn/pull/1491 of Apple's Anonymous Attestation Statement Format (fmt="apple"), the nonce generated from the authenticatorData the clientDataHash is embedded in an extension with OID ( 1.2.840.113635.100.8.2 ) in the certificate for the credential public key. If I try to validate a response generated after using touchID from my browser on my iOS14 device, I get a 38-byte value:   414:d=5  hl=2 l=   9 prim: OBJECT            :1.2.840.113635.100.8.2   425:d=5  hl=2 l=  38 prim: OCTET STRING      [HEX DUMP]:3024A1220420D9052FED7AA782C1B416C59B0AE15F309A336E22984E32505307A6339DDE52FD How can this be a SHA-256 hash value?
3
0
2.3k
Oct ’23
Subscribed calendar not updating for IOS 14 users
We have about 15,000 people subscribed to different calendars on our server. We’ve been inundated by IOS 14 users complaining their calendars in the Apple calendar app are no longer updating. IOS 13.x users are still getting updates to their calendars but it would appear IOS 14 users aren’t. Some reported a ‘verify account’ option showing in the list of calendars asking them to verify that an SSL connection wasn’t available to the calendar (even though it is). Clicking this does a one off update but no further automatic updates are done. Deleting the calendar and adding it in again works as a ‘one off’ but no further updates are done. Has anyone else come across this issue with IOS 14? (Still an issue on IOS 14.2 beta)
13
0
6.8k
Sep ’23
Experienced some issues with iOS VPN when running some apps like Speedtest and Roblox
Recently I experienced some weird issues with iOS VPN including personal VPN(IPsec VPN) and enterprise VPN(custom ssl VPN) when running some applications on both mac and iOS. I coded a network extension program which can run on both mac and iOS. In the network extension it intercepts the packets from the NEPacketTunnelFlow and encap them with a self defined header which is 16 bytes and send them via a UDP session to the remote server. test env: Xcode 12.0.1 / iOS 14.0 SDK / iPhone iOS 12.4.8 Here are some test results as following. IPSec VPN(personal VPN) which is supported natively by iOS: when running Speedtest from OOKLA it failed to test on mobile network(in my case it's 4G). The message shows ERROR Test failed to complete. Check your internet connection and try again OK There is no such issue on WIFI network. custom ssl VPN(enterprise VPN) created by using NETunnelProviderManager: On WIFI network run Roblox application on iPhone it failed when joining the server with error message Disconnected Failed to connect to the Game.(ID=17:Connection attempt failed.)(Error Code: 279) Leave I suspect it's related to the mtu setting so I tried with different tunnelOverheadBytes or mtu values:  on wifi network(my router's mtu is 1480):     work: -100/-16/20 (<=20)     not work: 21 (> 20)  on mobile network:     work:0/-16/-100(very slow)     not work: 1/2/5/10/20/21/28 (> 0)    It's weird that negative numbers work for overhead setting. And it seems on WIFI network the range of x <= 20 work for the Roblox game application( can join the server and play some games without any problems) and on mobile network the range is x <=0. Or set mtu instead of tunnelOverheadBytes:   on wifi network:     work:1480/1485/1490/1500     not work:1464/1479/1600     on mobile network:     work:1480/1485/1490/1500     not work:1464/1479/1600/2000 It seems the working value range is [1480, 1500] for both WIFI and mobile network. And also, Speedtest works on WIFI network but not on mobile network. To my understanding in the network extension we only need to set the tunnelOverheadBytes and the iOS will compute the mtu size and we don't need to care about the difference between different type of network. But actually there are differences. Now I'm totally confused. Apparently the value of tunnelOverheadBytes or mtu is quite critical for the network traffic. How to correctly set the tunnelOverheadBytes in the network extension for both WIFI and mobile network?
1
0
1.1k
Aug ’23
SwiftUI custom picker view?
I'm trying to create a custom Picker similar to the one in the Reminders app where users can select colors and icons for a list of reminders. I currently have this: struct CustomPickerStyle: PickerStyle {     static func _makeView<SelectionValue>(value: _GraphValue<_PickerValue<CustomPickerStyle, SelectionValue>>, inputs: _ViewInputs) -> _ViewOutputs where SelectionValue : Hashable {     }     static func _makeViewList<SelectionValue>(value: _GraphValue<_PickerValue<CustomPickerStyle, SelectionValue>>, inputs: _ViewListInputs) -> _ViewListOutputs where SelectionValue : Hashable {     } } These are automatically generated by Xcode. How should I deal with these methods? I could not find any documentation online for making a custom picker view... Thanks!
3
0
2.4k
Aug ’23
"No options were provided for this parameter" in Edit Widget menu
I had to create a separate thread for the problem I'm facing with WidgetKit. Environment: Xcode 12.0.1 iOS 14.0 App targeting iOS 10 Widget targeting iOS 14 Intents Extension targeting iOS 10 • I have created Intents Extension. • Created Intents Definition file in Widget target, added it to all the three targets (app, widget, intents extension).  • Declared conformance to the intent handling protocol in IntentHandler (Intents Extension). • Set up Intent Timeline Provider in Widget target.  • Added Siri to the app capabilities. If I go to Edit widget -> tap on a dynamic option it says: No options were provided for this parameter. Intents Extension provides data, but I'm not sure how iOS wires the Intents Extension and widget. From what I see I'm sure that my code inside IntentsHandler.swift is never called.
12
1
9.6k
Aug ’23
App not displayed in Settings App
Whenever I fresh install my app onto my device, it is not showing up in the Settings app. Even after trying to search it, nothing appears. I use location services and local network within my application so I need to be able to change those authorizations as it does not reliably prompt for those authorizations (I need always for location and that was removed, local network never prompts correctly). I have however seen my app appear in the settings app under privacy -> Location Services but not local network. Is this an issue with Apple or with my application? Should also be known that it does appear in settings on some devices.
14
3
20k
Sep ’23
iOS 14 Universal Links broken on default browser other than Safari
On iOS 14 you can pick another default browser than Safari. If you use another browser, that browser will ask the user to change their default browser.  I have installed quite a few browsers (Chrome, Firefox, Edge, Opera, Brave...) and have set each of them as my default one. Problem comes when I try to open a Universal Link (which was working just fine when Safari was the default browser), which seems to just not work. With Safari as default browser, the Universal Link would work, and the corresponding native app was getting opened. However, with any other browser different from Safari set as default, the feature is broken and the Universal Link doesn't open the native app. Has anyone experienced anything similar? Why might this happen and how might this be solved? Any help is very much welcomed
3
1
7.5k
Jul ’23
SwiftUI's onAppear() and onDisappear() called multiple times and inconsistently on iOS 14.1
I've come across some strange behavior with SwiftUI's onAppear() and onDisappear() events. I need to be able to reliably track when a view is visible to the user, disappears, and any other subsequent appear/disappear events (the use case is tracking impressions for mobile analytics). I was hoping to leverage the onAppear() and onDisappear() events associated with swiftUI views, but I'm not seeing consistent behavior when using those events. The behavior can change depending on view modifiers as well as the simulator on which I run the app. In the example code listed below, I would expect that when ItemListView2 appears, I would see the following printed out in the console: button init button appear And on the iPhone 8 simulator, I see exactly that. However, on an iPhone 12 simulator, I see: button init button appear button disappear button appear Things get even weirder when I enable the listStyle view modifier: button init button appear button disappear button appear button disappear button appear button appear The iPhone 8, however remains consistent and produces the expected result. I should also note that in no case, did the Button ever seem to disappear and re-appear to the eye. These inconsistencies are also not simulator only issues, i noticed them on devices as well. I need to reliably track these appear/disappear events. For example I'd need to know when a cell in a list appears (scrolled into view) or disappears (scrolled out of view) or when, say a user switches tabs. Has anyone else noticed this behavior? To me this seems like a bug in SwiftUI, but I'm not certain as I've not used SwiftUI enough to trust myself to discern a programmer error from an SDK error. If any of you have noticed this, did you find a good work-around / fix? Thanks, Norm // Sample code referenced in explanation // Using Xcode Version 12.1 (12A7403) and iOS 14.1 for all simulators import SwiftUI struct ItemListView2: View { &#9;&#9;let items = ["Cell 1", "Cell 2", "Cell 3", "Cell 4"] &#9;&#9;var body: some View { &#9;&#9;&#9;&#9;ListingView(items: items) &#9;&#9;} } private struct ListingView: View { &#9;&#9;let items: [String] &#9;&#9;var body: some View { &#9;&#9;&#9;&#9;List { &#9;&#9;&#9;&#9;&#9;&#9;Section( &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;footer: &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;FooterButton() &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;.onAppear { print("button appear") } &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;.onDisappear { print("button disappear") } &#9;&#9;&#9;&#9;&#9;&#9;) { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;ForEach(items) { Text($0) } &#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;} //&#9;&#9;&#9;.listStyle(GroupedListStyle()) &#9;&#9;} } private struct FooterButton: View { &#9;&#9;init() { &#9;&#9;&#9;&#9;print("button init") &#9;&#9;} &#9;&#9;var body: some View { &#9;&#9;&#9;&#9;Button(action: {}) { Text("Button")&#9;} &#9;&#9;} }
8
1
10k
Aug ’23
"Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed"
I recently got a new MacBook and I'm trying to get my projects up and running on it. When I run on an iOS 14.2 device, it works fine. But whenever I try 13.7 or lower it won't let me run and this error pops up Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed I would like this to work so I can test on older devices on this laptop. Note: I got the new M1 chip MacBook so if that could be an issue please do let me know.
17
2
13k
Sep ’23
Voice Over accessibility: UITableView
In our app, we display contacts in UITableView. Let us say I have 300 contacts in my AddressBook, and all of them will be displayed in this table. Below this table, I have a UIButton to perform some action like invite selected contacts. With Voice Over enabled, when I get to the UITableView, it doesn't let me to proceed to the UIButton, unless I go over all 300 contacts. Is there a solution to override this and make it more friendly to the visually impaired users?
2
0
3.1k
Aug ’23
UITableViewAlertForCellForRowAtIndexPathAccessDuringUpdate when selected cells are reused.
I'm getting this message in console: [Assert] Attempted to call -cellForRowAtIndexPath: on the table view while it was in the process of updating its visible cells, which is not allowed. Make a symbolic breakpoint at UITableViewAlertForCellForRowAtIndexPathAccessDuringUpdate to catch this in the debugger and see what caused this to occur. Perhaps you are trying to ask the table view for a cell from inside a table view callback about a specific row? Table view: <UITableView: 0x10c04a000; frame = (0 0; 414 659); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x280262bb0>; layer = <CALayer: 0x280d302c0>; contentOffset: {0, 183.5}; contentSize: {414, 3068}; adjustedContentInset: {0, 0, 0, 0}; dataSource: <MyApp.MyDataSource: 0x282930ea0>> It happens when my table view is in editing mode, some cells are selected and are about to be reused (I'm scrolling the table and selected cells leave the visible area). I don't call -cellForRowAtIndexPath: or visibleCells directly in my code. Here's the stack trace when this happens: Thread 1 Queue : com.apple.main-thread (serial) #0 0x0000000185303650 in UITableViewAlertForCellForRowAtIndexPathAccessDuringUpdate () #1 0x0000000185303378 in -[UITableView _cellForRowAtIndexPath:usingPresentationValues:] () #2 0x00000001852f1bb0 in -[UITableView _updateSelectionGroupingForCell:atIndexPath:] () #3 0x00000001852f1e78 in -[UITableView _updateSelectionGroupingForVisibleCells] () #4 0x00000001852af9d0 in -[UITableViewCell showSelectedBackgroundView:animated:] () #5 0x00000001852b045c in -[UITableViewCell setSelected:animated:] () #6 0x00000001852adf5c in -[UITableViewCell prepareForReuse] () #7 0x000000018530b2b4 in -[UITableView _dequeueReusableViewOfType:withIdentifier:] () #8 0x000000018530b908 in -[UITableView _dequeueReusableCellWithIdentifier:forIndexPath:usingPresentationValues:] () #9 0x000000018530b764 in -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:] () #10 0x000000010103a4cc in MyDataSource.tableView(_:cellForRowAt:) at /../MyDataSource.swift:87 #11 0x000000010103a9f4 in @objc MyDataSource.tableView(_:cellForRowAt:) () #12 0x00000001853241ec in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] () #13 0x00000001852eff84 in -[UITableView _updateVisibleCellsNow:] () #14 0x000000018530e394 in -[UITableView layoutSubviews] () #15 0x0000000185643d90 in -[UIView(CALayerDelegate) layoutSublayersOfLayer:] () #16 0x0000000185b59384 in -[CALayer layoutSublayers] () #17 0x0000000185b59858 in CA::Layer::layout_if_needed(CA::Transaction*) () #18 0x0000000185b6dff8 in CA::Layer::layout_and_display_if_needed(CA::Transaction*) () #19 0x0000000185ab3ee0 in CA::Context::commit_transaction(CA::Transaction*, double, double*) () #20 0x0000000185adf36c in CA::Transaction::commit() () #21 0x0000000185ae06fc in CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) () #22 0x00000001826c3358 in CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION () #23 0x00000001826bd5c4 in __CFRunLoopDoObservers () #24 0x00000001826bdb74 in __CFRunLoopRun () #25 0x00000001826bd21c in CFRunLoopRunSpecific () #26 0x000000019973c784 in GSEventRunModal () #27 0x00000001850f6200 in -[UIApplication _run] () #28 0x00000001850fba74 in UIApplicationMain () #29 0x000000010111a824 in main at /.../MyApp/AppDelegate.swift:17 #30 0x000000018237d6c0 in start () This only happens in iOS 14.2, no such problem on iOS 13.7. Does it look like an UIKit bug? Does anyone know how to solve it?
4
0
2.6k
Oct ’23
Enable local network access during iOS UI test in iOS14
We are building an iOS app that connects to a device using Bluetooth. To test unhappy flow scenarios for this app, we'd like to power cycle the device we are connecting to by using an IoT power switch that connects to the local network using WiFi (a Shelly Plug-S). In my test code on iOS13, I was able to do a local HTTP call to the IP address of the power switch and trigger a power cycle using its REST interface. In iOS 14 this is no longer possible, probably due to new restrictions regarding local network usage without permissions (see: https://developer.apple.com/videos/play/wwdc2020/10110 ). When running the test and trying a local network call to the power switch in iOS14, I get the following error: Task <D206B326-1820-43CA-A54C-5B470B4F1A79>.<2> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x2833f34b0 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <D206B326-1820-43CA-A54C-5B470B4F1A79>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=("LocalDataTask <D206B326-1820-43CA-A54C-5B470B4F1A79>.<2>"), NSLocalizedDescription=The internet connection appears to be offline., NSErrorFailingURLStringKey=http://192.168.22.57/relay/0?turn=on, NSErrorFailingURLKey=http://192.168.22.57/relay/0?turn=on, _kCFStreamErrorDomainKey=1} An external network call (to google.com) works just fine in the test. I have tried fixing this by adding the following entries to the Info.plist of my UI test target: <key>NSLocalNetworkUsageDescription</key> <string>Local network access is needed for tests</string> <key>NSBonjourServices</key> <array> <string>_http._tcp</string> </array> <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> However, this has no effect. I have also tried adding these entries to the Info.plist of my app target to see if that makes a difference, but it doesn't. I'd also rather not add these entries to my app's Info.plist, because the app does not need local network access. Only the test does. Does anyone know how to enable local network access during an iOS UI test in iOS14?
11
1
11k
4d
Battery health drain
Why is My 1 month old iPhone is draining battery health too fast, just one and half month old and it has already lost 2% battery health although i charge about only 50-60% charge daily and never charged it 0-100 then also please help if someone can.
20
1
35k
Aug ’23
How to prevent WKWebView open instagram app automatically?
I have been struggling to prevent WkWebView open Instagram app automatically when a user clicked a hyperlink on WKWebView. Currently, my app is able to open the new window/new tab request from my web app and load into a new ViewController which creating another WKWebView to handle the request. However, whenever I clicked the link which is opening the user's Instagram profile, iPhone will automatically open the installed Instagram app. I have tried a few approaches and it is still not working as expected. I have another social media app which is Facebook and it is working as expected because it doesn't open the installed Facebook app on my phone and able to load into the new ViewController. Scenario 1: Although able to open a new tab, but the entire webview has stopped working. Scenario 2: Unlimited loop due to will always trigger the decidePolicyFor function. Scenario 3: Delete installed Instagram app, It wouldn't open the app automatically and able to load into the local WkWebView but this is not the solution. Thank you in advance and sorry if I didn't provide a clear description. func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { &#9;&#9;if let host = navigationAction.request.url?.host { &#9;&#9;&#9; if host == "www.instagram.com" { &#9;&#9;&#9;&#9;&#9;&#9;&#9; &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;/* Scenario 2, unlimited loop */ &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if let url = navigationAction.request.url { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;let request = URLRequest(url: url) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;self.webView.load(request) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9; &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;/* Scenario 1, prevent loading user's instagram profile in local wkwebview */ &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;decisionHandler(.cancel) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;return &#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;} &#9; decisionHandler(.allow) }
3
0
2.8k
Sep ’23
Setting launch screen image through info.plist - image stretches to cover full screen
I am developing an app in swiftUI using Xcode 12.3, deployment target iOS 14.0. The launch screen is setup through info.plist by specifying 'background color' and 'image name'. The file used in 'image name' is from Assets catalog. (PNG format, size300 x 300 and corresponding @2x and @3x resolutions) What I have observed, when the app is installed for the first time the launch image is centered and have original resolutions but all subsequent launches show launch images stretched to cover full screen. Any ideas why this is happening and how to have more consistent behavior either way? I have tried 'respect safe area' option but it does not make a difference. Thank you.
11
2
9.1k
Aug ’23
iOS 14.x Custom Font Issue
We are having the below weird issue on 14.x devices Issue :    My application is a hybrid application. We have noticed an issue on 14.x related to loading the fonts mentioned in our CSS. The font file is not getting loaded occasionally. We couldn't infer much what is hindering the font loading on 14.x. In the previous version of iOS, this just works fine.   CSS:   @font-face{  font-family: "custom-font";src: url("fonts/custom-font.woff2")format("woff2"),  url("fonts/custom-font.woff")format("woff"),  url("fonts/custom-font.ttf")format("truetype") }     The above style sheet is linked to the page that we are loading.   Has anyone observed this issue on your project ? If so, please let us know the approach followed to resolve the same.     We also tried to follow the approach where the font file is loaded by native portion. The below approach works fine on iPhone Simulator but not on device, no clue why it's so   Added the font to the App and the file is targeted properly (Fonts provided by application key is updated). Ensure that the specific font is loaded and available using logs Used the font family in our CSS (we don't have to load the font on WkWebView space)
10
1
8.6k
Sep ’23
NLEmbedding not found after updating to iOS 14.4
When I try to get the sentence embedding with NLEmbedding.sentenceEmbedding(for: .english), I get nil returned and the message in the console is: "Unable to locate Asset for contextual word embedding model for local en." I've also tried different languages and also NLEmbedding.wordEmbedding(for: .english) doesn't work. This only occurs on my iPhone X after updating to iOS 14.4. Before it worked fine. It also works on the Simulator on iOS 14.4. Did somebody face a similar problem? Or does somebody know how to force iOS to download these embeddings again?
4
1
2.2k
Jul ’23