Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support react-native-macos #361

Open
shahthepro opened this issue Nov 15, 2020 · 7 comments
Open

Support react-native-macos #361

shahthepro opened this issue Nov 15, 2020 · 7 comments

Comments

@shahthepro
Copy link

Feature request

Add support for react-native-macos npm package and macOS target.

@vonovak
Copy link
Collaborator

vonovak commented Oct 2, 2021

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!

@jihoobyeon
Copy link

@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

@hsjoberg
Copy link

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

@hsjoberg
Copy link

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
 }
}

@jihoobyeon
Copy link

It seems to be hard because AppKit has NSOpenPanel and NSSavePanel separately.
maybe we have to make separate package to support macOS.

@danilaplee
Copy link

danilaplee commented Dec 21, 2022

#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

@danilaplee
Copy link

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 #612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants