Apple Developers

RSS for tag

This is a dedicated space for developers to connect, share ideas, collaborate, and ask questions. Introduce yourself, network with other developers, and foster a supportive community.

Learn More

Post

Replies

Boosts

Views

Activity

Partial Download Support for macOS NSFileProvider Implementation
I've implemented a file provider for macos, and it works well. Now I'm trying to add partial download support in my implementation. however, it doesn't seem to work. As per documentation, I've implemented protocol NSFileProviderPartialContentFetching and its method func fetchPartialContents(for: NSFileProviderItemIdentifier, version: NSFileProviderItemVersion, request: NSFileProviderRequest, minimalRange: NSRange, aligningTo: Int, options: NSFileProviderFetchContentsOptions, completionHandler: (URL?, NSFileProviderItem?, NSRange, NSFileProviderMaterializationFlags, (any Error)?) -> Void) -> Progress Now, I'm testing my implementation, and I open a movie from my File Provider using VLC. I see that fetchPartialContents get a hit. I download requested range, and return it through completionHandler. However VLC gives a read error. here is my implementation of fetchPartialContents: private func align(range: NSRange, to alignment: Int) -> NSRange { let start = range.location - (range.location % alignment) let end = range.location + range.length let alignedEnd = ((end + alignment - 1) / alignment) * alignment let alignedLength = alignedEnd - start return NSRange(location: start, length: alignedLength) } unc fetchPartialContents(for itemIdentifier: NSFileProviderItemIdentifier, version requestedVersion: NSFileProviderItemVersion, request: NSFileProviderRequest, minimalRange requestedRange: NSRange, aligningTo alignment: Int, options: NSFileProviderFetchContentsOptions = [], completionHandler: @escaping (URL?, NSFileProviderItem?, NSRange, NSFileProviderMaterializationFlags, (any Error)?) -> Void) -> Progress { let alignedRange = align(range: requestedRange, to: alignment) let progress = Progress(totalUnitCount: 100) let data = downloadData(for: alignedRange) progress.completedUnitCount = 100; tempFileHandle = try FileHandle(forWritingTo: tempFileURL) tempFileHandle.seek(toFileOffset: UInt64(alignedRange.location)) tempFileHandle.write(data!) tempFileHandle.closeFile() let item = FileProviderItem(identifier: itemIdentifier,) completionHandler(tempFileURL, item, alignedRange, [], nil) } catch { completionHandler(nil, nil, alignedRange, [], error) } } I beleive I'm doing everhting correctly & as per documentation, but certainly there is something is wrong. Can someone help me about it? cheers,
2
0
407
Aug ’24
Since "Sequoia", I've had a problem with CCLibrary.app
I'm not developer, so I don't know why I was sent to this forum, but: when I got a Beta OS notification from Apple for Sequoia ( I was using Sonoma), I accepted it and installed it, even though it was still in Beta. Since then, everything still works OK, but now I get a notification from Adobe 4-5 times per day telling me: "CCLIbrary.app" would like to access data from other apps". I can either "allow" or "don't allow" . I don't have the slightest idea what to do with the information. Other than avoiding beta versions of the Mac OS I'm on a Mac mini running Sequoia , OS15
0
0
304
Aug ’24
about pay apple developer program
who was like me : i register a new account ,but at pay time,be reject. then show me :Contact us to continue the process,There may be an issue with your account that needs to be resolved before you can continue with the sign-up process. Please contact support. i call many phone and post many email but is nothing,who can deal it? i buy a new macbook and iphone for this.but just start be force end.Do I need to return the product for a refund?
1
0
275
Aug ’24
How to implement iOS CallKit in Flutter to identify and store caller data within the app?
I am developing an app in Flutter and I need to implement iOS CallKit functionality to identify and store caller data within the app. I would like to know how to integrate CallKit into a Flutter application and what steps I need to follow to manage caller identification and data storage. I have done some research and understand that I will need to write native Swift code to handle CallKit, but I am not sure how to properly integrate it with Flutter and manage communication between the native code and Dart code. My specific questions are: How do I set up CallKit in a Flutter project? What permissions and configurations do I need in the Info.plist file? How can I receive and handle incoming call data using CallKit? How can I communicate this data to the Dart code in Flutter to store and display it in the user interface? Any code examples, tutorials, or advice would be greatly appreciated. Thanks in advance for your help. I have tried several approaches to implement iOS CallKit in my Flutter app: Online Forums: I have researched various online forums and discussion boards where developers share their experiences and solutions for integrating CallKit with Flutter. Unfortunately, I have not found a complete solution that addresses my specific requirements. Pub.dev Packages: I have explored different packages available on pub.dev, such as flutter_callkit_incoming and flutter_callkit, and tried to implement them in my project. However, I have encountered issues with proper integration and communication between the native Swift code and Flutter. GitHub Repositories: I have also looked at several GitHub repositories where developers have shared their implementations of CallKit in Flutter. While these repositories provided some insights, I was unable to achieve the desired functionality on my physical device. Despite following the instructions and examples from these sources, I have not been able to get CallKit to work correctly on my physical device. I am expecting to be able to identify the caller, and store the caller data within my Flutter app.
1
0
383
Aug ’24
Loss of internet connectivity with iOS 18 Beta4
I too have experienced loss of internet connectivity even though both wifi and cell data are connected and are available. I also experienced this with iOS 17 including latest betas. I have noticed that on iOS 18 Beta releases that the loss of internet seems to be triggered when I enable VPN and then disable VPN. If I enable VPN again, internet data does partially return however some apps don’t show access to internet still. Nothing fixes this other than a power off/on. Resetting network settings , airplane mode on/off doesn’t resolve the issue. This was not an issue using iOS 16. Problems started with iOS 17 and are still there in iOS 18.
0
0
278
Aug ’24
In iOS 18 beta 5 version, setting the conversion to NSAttributedString using [.documentType: NSAttributedString.DocumentType.html] occasionally causes crashes
In iOS 18 beta 5 version, setting the conversion to NSAttributedString using [.documentType: NSAttributedString.DocumentType.html] occasionally causes crashes The same issue was encountered in previous versions. However, after running the code on the main thread, it no longer crashed. But after upgrading to the iOS 18 beta 5 version, it occasionally crashes even when running on the main thread. How can this issue be resolved?
2
0
506
Aug ’24
Need to help with reading the crash logs
When I submitted my app, they rejected it because the app crashed when implementing the app. They sent me the crash logs. Can someone guide me on how to read them and navigate me to identify the help? crashlog-268C087C-3E75-4982-A08D-60DEFEE5AD95.txt crashlog-22278F0D-EF70-4799-B6E0-C2E001A960D6.txt
2
0
344
Aug ’24
Need to change the screenshots in the App Store
We recently submitted the app and I am putting some normal screenshots for submission. For that, I need to change those and present them in an attractive way, but there's no edit option for screenshots in Apple Connect. Is there any potential to change it? Also, it is published from my personal account and I need to change my personal name to the app name. Is there any potential to change it also?
1
0
188
Aug ’24
vlc compile error
CC spu/dynamicoverlay/dynamicoverlay_buffer.lo CC spu/dynamicoverlay/dynamicoverlay_queue.lo CC spu/dynamicoverlay/dynamicoverlay_commands.lo CC spu/dynamicoverlay/dynamicoverlay.lo CCLD libdynamicoverlay_plugin.la CC stream_extractor/libarchive_plugin_la-archive.lo CCLD libarchive_plugin.la ld: library 'b2' not found clang: error: linker command failed with exit code 1 (use -v to see invocation) make[4]: *** [libarchive_plugin.la] Error 1 make[3]: *** [all-recursive] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2
0
0
240
Aug ’24
Convert view to PDF
I'm trying to convert a view (ScrollView) to PDF, on my physical device iPhone 7 with iOS 15.8 it works perfectly, but on my friends' iPhone 11 and iPhone 13 both with iOS 17+ the application crashes at the time of conversion, it also crashes in the xCode preview and in the Simulators without showing errors. I call the function like this: Button(action: { if included && !saving { if signatureImage != nil { exportPDF(name: "ToR-(patient.name)-(patient.id)") { self } completion: { status, url in if let url = url, status { self.PDFUrl = url self.showActionSheet.toggle() print("URL => (url) - Status (status)") } else { print("Failed") } } } else { self.scrollToBottom = true } } }) { if saving { ProgressView() .tint(Color("MainColor")) .scaleEffect(1.5) } else { Text(NSLocalizedString("Save", comment: "")) } } And the function is this: import SwiftUI import UIKit extension View { func convertToScrollView<Content: View>(@ViewBuilder content: @escaping () -> Content) -> UIScrollView { let scrollView = UIScrollView() let hostingController = UIHostingController(rootView: content()).view! hostingController.translatesAutoresizingMaskIntoConstraints = false let constraints = [ hostingController.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor), hostingController.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor), hostingController.topAnchor.constraint(equalTo: scrollView.topAnchor), hostingController.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor), hostingController.widthAnchor.constraint(equalToConstant: screenBounds().width) ] scrollView.addSubview(hostingController) scrollView.addConstraints(constraints) scrollView.layoutIfNeeded() return scrollView } func exportPDF<Content: View>(name: String, @ViewBuilder content: @escaping () -> Content, completion: @escaping (Bool, URL?) -> ()) { let documentDirectory = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first! let outputFileURL = documentDirectory.appendingPathComponent("\(name).pdf") let pdfView = convertToScrollView { content() } pdfView.tag = 1009 let size = pdfView.contentSize pdfView.frame = CGRect(x: 0, y: getSafeArea().top, width: size.width, height: size.height) getRootController().view.insertSubview(pdfView, at: 0) let renderer = UIGraphicsPDFRenderer(bounds: CGRect(x: 0, y: 0, width: size.width, height: size.height)) do { try renderer.writePDF(to: outputFileURL, withActions: { context in context.beginPage() pdfView.layer.render(in: context.cgContext) }) completion(true, outputFileURL) } catch { completion(false, nil) print(error.localizedDescription) } getRootController().view.subviews.forEach { view in if view.tag == 1009 { view.removeFromSuperview() } } //pdfView.removeFromSuperview() } func screenBounds() -> CGRect { return UIScreen.main.bounds } func getRootController() -> UIViewController { guard let screen = UIApplication.shared.connectedScenes.first as? UIWindowScene else { return .init() } guard let root = screen.windows.first?.rootViewController else { return .init() } return root } func getSafeArea() -> UIEdgeInsets { guard let screen = UIApplication.shared.connectedScenes.first as? UIWindowScene else { return .zero } guard let safeArea = screen.windows.first?.safeAreaInsets else { return .zero } return safeArea } }
4
0
445
Aug ’24