facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.41k stars 24.25k forks source link

Support for Android Auto / Apple Carplay #19900

Closed ahmadkhudeish closed 6 years ago

ahmadkhudeish commented 6 years ago

For Discussion

Hi there,

Are there any plans to support Android Auto / Apple Carplay on React Native?

Cheers Ahmad

fungilation commented 6 years ago

Interesting question. On a UI level, it could work similarly to tvOS?

ahmadkhudeish commented 6 years ago

@fungilation that's right, I only need to use it on a UI level. I can use Android Auto from the Native API using Java or Kotlin but I want to use it with React Native. I haven't found any resources about this. any ideas if this is already supported in RN?

hramos commented 6 years ago

There's no explicit support for CarPlay in the React Native library itself, because CarPlay is a native SiriKit feature. You can set up your Xcode project to support CarPlay as you normally would, regardless of whether you are using React Native or not in your application.

If you are interested in using React Native to drive the CarPlay screen, it appears CarPlay would require your view controller to use a specific subset of UIKit components and to adhere to CarPlay's limitations.

I personally do not know if it's possible to use a React Native backed view to drive this - I'd be surprised if it works right now - but this use case does seem better served by using CarKit directly. I don't see much benefit in using React Native here. I'd be interested in hearing more about your particular use case, and why React Native would be useful to you here. Can post in https://discuss.reactjs.org/ instead? A GitHub issue is not the best place for this type of question.