Open shahthepro opened 4 years ago
hello, I do not plan to do this but am open to be hired to do this or review a PR that implements this. 🙂
thank you!
@shahthepro It seems like you have to use Mac Catalyst since UIDocumentPickerViewController
doesn't support macOS natively.
https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller?language=objc
AppKit has a different API instead of UIDocumentPickerViewController
for dealing with save and open dialogs.
https://github.com/hsjoberg/blixt-wallet/blob/431ff0d60a423c44d77ba48be46da026b92b6bd0/ios/LndMobile/LndMobileTools.swift#L227-L252
Here's a simple example in Swift on how to open a file
DispatchQueue.main.async {
do {
let panel = NSOpenPanel()
panel.allowsMultipleSelection = false
panel.canChooseDirectories = false
if panel.runModal() == .OK {
if let u = panel.url {
let base64 = try Data(contentsOf: u).base64EncodedString())
} else {
// error
}
} else {
// ...
}
}
catch {
// exception
}
}
It seems to be hard because AppKit has NSOpenPanel and NSSavePanel separately.\ maybe we have to make separate package to support macOS.
https://github.com/rnmods/react-native-document-picker/pull/612 added the barebones support can anyone test this one in ios, because i currently don't have a stable ios build of my app
I have tested only on mac os
hello, I do not plan to do this but am open to be hired to do this or review a PR that implements this. 🙂
thank you!
done https://github.com/rnmods/react-native-document-picker/pull/612
Feature request
Add support for react-native-macos npm package and
macOS
target.