[英]Embed react native app inside existing ios/android app
I need to know if it is possible to "embed" a react native app within an existing ios/android app without sharing the react native app code. 我需要知道是否有可能在不共享React Native应用代码的情况下“嵌入”现有ios / android应用中的React Native应用。
We currently have a react native app which use a few plugins dependencies and was asked if it would be possible to embed it within an existing native app (ie as a subview) and make both parts communicate with each other. 当前,我们有一个React Native应用程序,该应用程序使用一些插件依赖性,并被问及是否有可能将其嵌入到现有的本机应用程序中(即作为子视图)并使两个部分彼此通信。
I know it is possible to do it ( https://facebook.github.io/react-native/docs/communication-ios.html ) but I'm rather wondering how to achieve it without sharing our current code with the existing app that needs our app to be embedded. 我知道可以做到这一点( https://facebook.github.io/react-native/docs/communication-ios.html ),但我很想知道如何在不与现有应用共享我们当前代码的情况下实现它需要将我们的应用程序嵌入。
Is there any way to embed it as a bundle, a widget or even grab it from a private repo while building? 有什么方法可以在构建时将其嵌入为捆绑包,小部件,甚至从私有存储库中获取它?
Thanks 谢谢
From the documentation you linked: 从您链接的文档中:
In order to embed a React Native view in a native component, we use RCTRootView.
为了在本地组件中嵌入React Native视图,我们使用RCTRootView。 RCTRootView is a UIView that holds a React Native app.
RCTRootView是一个拥有React Native应用程序的UIView。 It also provides an interface between native side and the hosted app.
它还提供了本机端与托管应用之间的接口。
You can produce an iOS Framework that includes this RCTRootView
. 您可以生成一个包含此
RCTRootView
的iOS框架。 You should be able to distribute the binary framework if you don't want to distribute the source. 如果您不想分发源代码,则应该能够分发二进制框架。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.