简体   繁体   中英

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.

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.

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.

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. RCTRootView is a UIView that holds a React Native app. It also provides an interface between native side and the hosted app.

You can produce an iOS Framework that includes this RCTRootView . You should be able to distribute the binary framework if you don't want to distribute the source.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM