Support Project Catalyst (running iPad apps on macOS) #382
Replies: 47 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
-
Didn't they also announce iPadOS? How does this affect react-native now that iOS and IPadOS might be two separate targets |
Beta Was this translation helpful? Give feedback.
-
Ok, so let's keep the discussion here, it fits better the format. Few points (which ofc take with a pinch of salt):
|
Beta Was this translation helpful? Give feedback.
-
I mean.. there is no Facebook.app for the mac right?? And it would be nice to reuse the iOS code, right? wink wink? :p |
Beta Was this translation helpful? Give feedback.
-
That it can work I and some more people demonstrated but took some adjustments in the core of React Native; mostly deprecated API's because you must target the latest iOS/Mac. Planned to make a POC in the coming weeks with 0.60 to see what is working and needed change |
Beta Was this translation helpful? Give feedback.
-
Ya I'm looking for docs and experience on this. How automatic is such "porting" from iPad to Mac? Relevant, important links while I was researching this:
I disagree about treating ipadOS support in RN like tvOS. The latter is very different, while ipadOS is for all intents and purposes of app makers, the same as iOS 13. Dimensions window support for Split View and Slide Over on iPad in #16152 link above means afaik, I got what I need to fully convert my iPhone RN app to support the iPad's screen. Add splitView so my 1 column iPhone layout become 2 columns, then it should be ready for the new Catalyst conversion for macOS. Apple's new HIG docs for iPad apps on Mac says explicitly that splitView on iPad will get automatic conversion to equivalent on macOS. So this is my own plan for bringing my iPhone app (WonderSwipe) to iPad and Mac. Am I missing anything that needs RN core support to make happen, or am I right that all the pieces are already in place as I've outlined above? RNN provides the splitView, while Xcode 11 provides not just iPad layout but also a new Mac option you simply turn on. Will share hiccups I get along the way. Anyone else thinking/planning something similar, on iPad/Mac adaptations of your RN apps? What else do you see missing inside RN that's needed for these adaptations? |
Beta Was this translation helpful? Give feedback.
-
I strongly disagree. tvOS is treated by Apple as a separate OS, with most things in common with iOS and UIKit, but a separate target nonetheless. iPadOS is only a marketing term. It's not really a separate OS, from a technical standpoint. UIKit for Mac / Marzipan / Catalyst is a weird beast, but the way Apple treats it, Mac is only a separate device target for the iOS app. It's not listed as a separate OS in code (all platform checks reference iOS, not macOS), and you're not really supposed to create a separate Xcode target for Catalyst apps (the way you are for tvOS or watchOS -- or truly native/AppKit Mac apps), just check the checkbox, add necessary configuration for macOS, and if necessary -- add extra Therefore, the core of RN for Catalyst apps should remain the same, and in the same repo. A react-native-community repo(s) might (and should) spring up for enhancing Catalyst apps (supporting extra features only available for the Mac). |
Beta Was this translation helpful? Give feedback.
-
👋 Radek - yeah, again, my was literally just a feeling because I wasn't really able to understand what iPad OS really was back then. Upon further investigation, and your comment, I can rollback that 100%, yeah it's basically still iOS13 from our perspective 🤗 |
Beta Was this translation helpful? Give feedback.
-
Heads up: I began initial for for supporting Catalyst in React Native. More work needs to be done to polish everything to look good, but in general it was an hour or two of work to get it to compile properly: |
Beta Was this translation helpful? Give feedback.
-
@radex will your commit make it to rn 61? do you think real world projects will build successfully for mac? |
Beta Was this translation helpful? Give feedback.
-
@brunolemos I think it will make it to RN 61, but it's only the first step -- web socket doesn't work which is annoying for development, the layout and fonts are all broken… You should help out and contribute too :) |
Beta Was this translation helpful? Give feedback.
-
Any news about this? Catalina is going to be released this month, will it bring anything useful in scope of this topic? |
Beta Was this translation helpful? Give feedback.
-
Tried to build for mac (react-native 0.61.2). Had build errors related to firebase (invertase/react-native-firebase#2698, firebase/firebase-ios-sdk#3144). Then I removed firebase. Got this error:
Removed the websocket pod but no change. How to pass through this error? |
Beta Was this translation helpful? Give feedback.
-
facebook/react-native#25427 did most of the work for apps not using RCTWebSocket, but more help are still needed for other apps like mine. 😔 |
Beta Was this translation helpful? Give feedback.
-
@brunolemos RCTWebSocket didn't compile for Catalyst, so I ifdef'ed it out of React Native build. If you manage to get to compile, send a PR to react-native repo |
Beta Was this translation helpful? Give feedback.
-
Introducing keyboard shortcuts to show up the dev menu here: facebook/react-native#27479. |
Beta Was this translation helpful? Give feedback.
-
Anyone has made it work with the latests |
Beta Was this translation helpful? Give feedback.
-
@mgcrea, for now, you can just disable Flipper since it seems to be the cause of the error. You can comment out the lines that mention flipper in the |
Beta Was this translation helpful? Give feedback.
-
Quick question, how to run with Mac target from console, is there an analog for |
Beta Was this translation helpful? Give feedback.
-
@kirill-konshin |
Beta Was this translation helpful? Give feedback.
-
@Naturalclar I just tried |
Beta Was this translation helpful? Give feedback.
-
I think they haven’t released a new version containing this commit. I’m not one of the maintainers so I don’t know when they will release it either. You can use something like patch-package to manually apply the commit diff as a workaround. |
Beta Was this translation helpful? Give feedback.
-
Seems that macos support not planned in nearest future. |
Beta Was this translation helpful? Give feedback.
-
Microsoft is hard at work building out the react-native-macos platform, which in my opinion is a far better solution than relying on Project Catalyst. Just recently they merged this PR: microsoft/react-native-macos#291 |
Beta Was this translation helpful? Give feedback.
-
That's just amazing! Agree that project Catalyst has many shortcomings, eg. any macOS specific API is unavailable like handling file drops, using system menu, etc. that makes it currently a pretty poor option to build real applications. |
Beta Was this translation helpful? Give feedback.
-
@kevinvangelder I've created react-native(*) native module using $ create-react-native-module MyNativeModule --generate-example and build&run it on MacOS. So in theory I can implement in that module all that I can do in ordinary Objective-C application and connect it to react-native ui. Or I wrong?
|
Beta Was this translation helpful? Give feedback.
-
@Andreychikov-Vasiliy Yes, in theory you should be able to write a Swift/Obj-C module using macOS APIs. You may run into shortcomings working with the react-native-macos bridge implementation (I don't know how complete it is in it's current state), but if you have issues now I would expect that they'll be resolved in the near future as Microsoft is putting a lot of time and effort into this. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I was trying to add mac Catalyst to my project. However, I am getting |
Beta Was this translation helpful? Give feedback.
-
Apple has just announced Project Catalyst on WWDC 2019, which allows iOS/iPad apps to run on macOS without modification. This is AWESOME.
We'd love if React Native could build and work correctly on macOS. That should be a supported scenario.
Beta is already available today for developers to test.
EDIT: Stable version of macOS Catalina is already available.
https://techcrunch.com/2019/06/03/ios-apps-will-run-on-macos-with-project-catalyst/
Beta Was this translation helpful? Give feedback.
All reactions