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
macOS Support #1057
macOS Support #1057
Conversation
I felt that folder structure is pretty intuitive. You can go to each folder and do things there separately without affecting other ones. It has become a second habit for me to go the mac folder and run - |
@@ -72,7 +72,7 @@ - (NSDictionary *)constantsToExport { | |||
- (id)init | |||
{ | |||
if ((self = [super init])) { | |||
#if !TARGET_OS_TV | |||
#if (!TARGET_OS_TV && !TARGET_OS_OSX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recognize it's draft and you're just getting compile to work, but seems OSX should likely have battery information as well? Laptop use case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, still need to implement that.
Documented here: https://developer.apple.com/documentation/kernel/iopmpowersource#//apple_ref/doc/uid/TP40012438
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exciting! I won't approve or reject now since it's just draft, but I left some collaborating comments. Thanks for proposing this
@@ -21,7 +21,7 @@ if (!RNDeviceInfo) { | |||
throw new Error(`@react-native-community/react-native-device-info: NativeModule.RNDeviceInfo is null. To fix this issue try these steps: | |||
β’ For react-native <= 0.59: Run \`react-native link react-native-device-info\` in the project root. | |||
β’ Rebuild and re-run the app. | |||
β’ If you are using CocoaPods on iOS, run \`pod install\` in the \`ios\` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods. | |||
β’ If you are using CocoaPods on iOS or macOS, run \`pod install\` in the \`ios\` or \`macos\` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
β’ If you are using CocoaPods on iOS or macOS, run \`pod install\` in the \`ios\` or \`macos\` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods. | |
β’ If you are using CocoaPods for apple targets, run \`pod install\` in the \`macos\` directory, then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods. |
I think this is more accurate? I'm always iffy on wording and documentation though, feel free to mash the words around, but I don't think the ios directory will exist so that at least should be removed
You are steadily chewing through this! nice |
Yup! Aiming to finish this week π |
Excellent! I'm not making any promises (open source and all...) but I've been reading about github actions and I hope to have some CI up including a catalyst and macos build target CI check so that none of us accidentally silently break your work in the future :) |
Sounds good! I can take a stab at it too after I finish up the functions |
Hello π, this PR has been opened for more than 2 months with no activity on it. If you think this is a mi stake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed a utomatically |
maintainer pinging themselves ;-) |
Hello π, this PR has been opened for more than 2 months with no activity on it. If you think this is a mi stake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed a utomatically |
still on my list, just contract work killin' me at the moment |
Hello π, this PR has been opened for more than 2 months with no activity on it. If you think this is a mi stake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed a utomatically |
I continue to be sad I haven't had the time to get this in yet. Some day... |
Any updates as of Sep 1st 2022. is there support for macOS yet |
No sorry, this is eternally back-burner. It's something I want to do but I just don't have the time and the time I do have is better spent on higher value (that is: impacts more users) projects, like getting macCatalyst to even work with react-native, which I did this Spring. I'd love for anyone to take this up, and I'm sorry I could get it done but that's living... |
Where you able to get macCatalyst working with React Native. if so do you have a GitHub link to that project. I have been looking to use macCatalyst with React Native as well |
@elmcapp I have a fully scripted demonstration (you'll need to set your DEVELOPMENT_TEAM_ID) though, with react-native-firebase working, on macCatalyst, here: https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh In particular there used to be (through react-native 0.69) a number of workarounds involved: but myself and a few others got them upstream in a single flag now - https://github.com/facebook/react-native/blob/12e5842e11ecd53755f43e99c592135b58ac694b/template/ios/Podfile#L37-L39 Those will release with react-native 0.70 |
Hello π, this PR has been opened for more than 2 months with no activity on it. If you think this is a mi stake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed a utomatically |
Hey @mikehardy, i'm willing to give it a shot, try to solve this one out. As i can see, it's required to support all methods, which could be possible on macOS? |
@fi-nik that is the general idea - support all the methods that could be possible - but incremental progress (supporting the methods that are important to you) would be a fine start |
|
Hello π, this PR has been opened for more than 2 months with no activity on it. If you think this is a mi stake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed a utomatically |
Description
Added support for macOS. This is the beginning of macOS support. Currently did enough to get the build to work on macOS, I'll spend the next couple of days making sure the returned values are correct!
I do not mind PRs to help out π
One thing I noticed is now theChanged to apple πiOS
folder has implementations for iOS, tvOS, and macOS. A common scheme Microsoft uses and react-native-webview uses is naming the directoryapple
, should we follow that scheme?Possible functions that need more expertise to be implemented or more time outside the scope of this:
getBatteryLevel(): https://developer.apple.com/documentation/kernel/iopmpowersource#//apple_ref/doc/uid/TP40012438
isCameraPresent(): https://developer.apple.com/documentation/avfoundation/avcapturedevice
getInstallerPackageName(): is this the same as getBundleId()?
Check List before ready for merge
Promise<string>
Promise<number>
string
Promise<Object>
{ headingAvailable: false, locationServicesEnabled: true, significantLocationChangeMonitoringAvailable: true }
Promise<string>
Promise<string>
Promise<number>
Promise<string>
string
string
string
Promise<boolean>
Promise<string>
Promise<string>
Promise<string>
string
string
Promise<string>
Promise<string>
Promise<string>
[Error: The operation couldnβt be completed. (com.apple.devicecheck.error error 0.)]
Promise<number>
Promise<string>
Promise<number>
Promise<number>
Promise<string>
Promise<string>
Promise<string>
Promise<string>
Promise<string>
Promise<string>
Promise<string>
Promise<number>
Promise<string>
Promise<string>
Promise<number>
string
Promise<string>
Promise<object>
Promise<string>
Promise<number>
string
Promise<string>
Promise<string>
Promise<string[]>
string
string
Promise<string>
Promise<string>
Promise<number>
Promise<number>
string
Promise<number>
Promise<string>
string
boolean
Promise<boolean>
Promise<boolean>
Promise<boolean>
Promise<boolean>
Promise<boolean>
Promise<boolean>
Promise<boolean>
Promise<boolean>
boolean
Promise<string[]>
Promise<string[]>
Promise<string[]>
Promise<string>
Compatibility
Checklist
README.md
CHANGELOG.md
privateTypes.ts
,types.ts
)example/App.js
)