简体   繁体   English

将React Native应用程序嵌入现有的ios / android应用程序中

[英]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.

相关问题 如何在 react-native 应用程序中打开网站(Android 和 iOS) - How to open an website inside the react-native app(Android and iOS) 我可以使用 React Native 上新制作的应用程序更新我现有的 Android 和 iOS 应用程序吗? - Can I update my existing Android and iOS app with freshly made app on React Native? 将 react-native 集成到现有的 Android 应用程序中 - Integrating react-native into existing Android App 将react-native集成到现有的android应用程序? - Integrating react-native to an existing android app? 如何在现有的 React Native App 中集成原生 ios 摄像头 SDK? - How to integrate native ios camera SDK in existing react native App? 如何用 Flutter 应用替换现有的原生 Android/iOS 应用? - How to replace existing native Android/iOS app with Flutter app? android 和 ios 应用订阅检查反应原生 - android and ios app subscription checking in react native 从集成到现有 Android 应用程序中的 React Native 应用程序获取结果 - Get a result from a react native app integrated into an existing android app 如何将 react-native 应用程序作为模块集成到现有的 android 应用程序中? - How to integrate react-native app as a module in existing android app? 您可以在 android/ios 应用程序中嵌入统一应用程序吗? - Can you embed a unity application inside an android/ios app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM