Post

Replies

Boosts

Views

Activity

Issue: API Call Delays (5-10 Minutes) on Real Device in tvOS 18 After Call Completes, Works Fine in Debug Mode and Simulator
I am encountering an issue when making an API call using URLSession with DispatchQueue.global(qos: .background).async on a real device running tvOS 18. The code works as expected on tvOS 17 and in the simulator for tvOS 18, but when I remove the debug mode, After the API call it takes few mintues or 5 to 10 min to load the data on the real device. Code: Here’s the code I am using for the API call: appconfig.getFeedURLData(feedUrl: feedUrl, timeOut: kRequestTimeOut, apiMethod: ApiMethod.POST.rawValue) { (result) in self.EpisodeItems = Utilities.sharedInstance.getEpisodeArray(data: result) } func getFeedURLData(feedUrl: String, timeOut: Int, apiMethod: String, completion: @escaping (_ result: Data?) -> ()) { guard let validUrl = URL(string: feedUrl) else { return } var request = URLRequest(url: validUrl, cachePolicy: .useProtocolCachePolicy, timeoutInterval: TimeInterval(timeOut)) let userPasswordString = "\(KappSecret):\(KappPassword)" let userPasswordData = userPasswordString.data(using: .utf8) let base64EncodedCredential = userPasswordData!.base64EncodedString(options: .lineLength64Characters) let authString = "Basic \(base64EncodedCredential)" let headers = [ "authorization": authString, "cache-control": "no-cache", "user-agent": "TN-CTV-\(kPlateForm)-\(kAppVersion)" ] request.addValue("application/json", forHTTPHeaderField: "Content-Type") request.httpMethod = apiMethod request.allHTTPHeaderFields = headers let response = URLSession.requestSynchronousData(request as URLRequest) if response.1 != nil { do { guard let parsedData = try JSONSerialization.jsonObject(with: response.1!, options: .mutableContainers) as? AnyObject else { print("Error parsing data") completion(nil) return } print(parsedData) completion(response.1) return } catch let error { print("Error: \(error.localizedDescription)") completion(response.1) return } } completion(response.1) } import Foundation public extension URLSession { public static func requestSynchronousData(_ request: URLRequest) -> (URLResponse?, Data?) { var data: Data? = nil var responseData: URLResponse? = nil let semaphore = DispatchSemaphore(value: 0) let task = URLSession.shared.dataTask(with: request) { taskData, response, error in data = taskData responseData = response if data == nil, let error = error { print(error) } semaphore.signal() } task.resume() _ = semaphore.wait(timeout: .distantFuture) return (responseData, data) } public static func requestSynchronousDataWithURLString(_ requestString: String) -> (URLResponse?, Data?) { guard let url = URL(string: requestString.checkValidUrl()) else { return (nil, nil) } let request = URLRequest(url: url) return URLSession.requestSynchronousData(request) } } Issue Description: Working scenario: The API call works fine on tvOS 17 and in the simulator for tvOS 18. Problem: When running on a real device with tvOS 18, the API call takes time[enter image description here] when debug mode is disabled, but works fine when debug mode is enabled, Data is loading after few minutes. Error message: Error Domain=WKErrorDomain Code=11 "Timed out while loading attributed string content" UserInfo={NSLocalizedDescription=Timed out while loading attributed string content} NSURLConnection finished with error - code -1001 nw_read_request_report [C4] Receive failed with error "Socket is not connected" Snapshot request 0x30089b3c0 complete with error: <NSError: 0x3009373f0; domain: BSActionErrorDomain; code: 1 ("response-not-possible")> tcp_input [C7.1.1.1:3] flags=[R] seq=817957096, ack=0, win=0 state=CLOSE_WAIT rcv_nxt=817957096, snd_una=275546887 Environment: Xcode version: 16.1 Real device: Model A1625 (32GB) tvOS version: 18.1 Debugging steps I’ve taken: I’ve verified that the issue does not occur in debug mode. I’ve confirmed that the API call works fine on tvOS 17 and in the simulator (tvOS 18). The error suggests a network timeout (-1001) and a socket connection issue ("Socket is not connected"). Questions: Is this a known issue with tvOS 18 on real devices? Are there any specific settings or configurations in tvOS 18 that could be causing the timeout error in non-debug mode? Could this be related to how URLSession or networking behaves differently in release mode? I would appreciate any help or insights into this issue!
1
0
114
6d
Missing Private key in CER file after installation in keychain
Creating CSR file from my Mac steps are :- Going to the Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority... Filling the required details in the field, save to desk then continue and save it desktop. Then going to the Developer account in Certification screen and creating a new certificate on click on plus icon then selecting Apple distribution > continue , Then uploading CSR file in the required box and continue. After this I have downloaded the “distribution.cer” file then double clicked on the file then going to the KeyChain Access to see the My Certificate section there is no certificate which I have installed but it showing in the Certificate section without Private key. This steps I have followed but not getting Private key in my certificate how to correct this issue System Configuration :- Mac OS- 14.5 Chip - Apple M1 Keychain Access version - Version 11.0 (55314)
0
0
179
4w
how to resolve failed to emit precompiled header this error.
i am facing issue using xcode 14.3, the error is failed to emit precompiled header '/Users/Library/Developer/Xcode/DerivedData/ksl-eyxaasnuhobrniasqskqxatrixxw/Build/Intermediates.noindex/PrecompiledHeaders/TEBridge-Header-swift_YVK8DW4UEVT6-clang_2GLMX79PBJ59I.pch' for bridging header '/Users/Desktop/GA-4For mobile/ott-ios-Latest-16-June/ksl/Utilities/Resources/TEBridge-Header.h'
1
0
1.9k
Jun ’23
Apple reject app
Hello Everyone, Apple rejects app due to this crash and attached couple of crash logs, from where it hard to find out what's the exact reason behind it, Can anyone help me out. crashlog-542E9683-FEF0-49D6-A9B5-E92DB6FCAA93.txt crashlog-4139CEFD-E45A-46AC-BA9C-C77ED036B0FD.txt crashlog-7513B474-0E68-4B43-ACD9-4EC112E3BAAA.txt crashlog-9590010E-D2B1-430A-84DA-94F0BA6E1232.txt
1
0
779
Jan ’23
AVPlayer produce the error.
I am using the AVPlayer for playing the video. But my problem i.e, the the player is occurring the error. while the same url is already to play in to the Android device and Safari web browser also. If this url replaced by the other url it's working fine.This is the error.player.error==========&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;Optional(Error Domain=AVFoundationErrorDomain Code=-11848 "Cannot Open" UserInfo={NSUnderlyingError=0x156d78f30 {Error Domain=NSOSStatusErrorDomain Code=-12925 "(null)"}, NSLocalizedFailureReason=The media cannot be used on this device., NSLocalizedDescription=Cannot Open})override func viewDidLoad() { super.viewDidLoad() let videoUrl = "http://telvuehls_t03007-i.akamaihd.net/hls/live/217085/T03007-calkins/playlist.m3u8" let playerItem = AVPlayerItem(URL: NSURL(string: videoUrl as String)!) let playerObj = AVPlayer(playerItem: playerItem) self.player = playerObj if playerItem.error == nil{ playerObj.play() }else{ print("player.error==========&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;\(playerItem.error)") } }
4
0
3.9k
Oct ’16