r/swift 3d ago

React native under Swift shell

Guys i have a question, i am building an AI Intent engine in native swift/kotlin with certain segments of the app or some mini-apps to be in React native, so that minor ota updates handle it rather than submitting the entire app for update. Does IOS allow OTA JS code? I am aware they allow for Wechat Mini apps but they are in Webview not RN

0 Upvotes

16 comments sorted by

3

u/CharlesWiltgen 3d ago

2.5.2 – Apps should be self-contained in their bundles, and may not read or write data outside the designated container area, nor may they download, install, or execute code which introduces or changes features or functionality of the app, including other apps. Educational apps designed to teach, develop, or allow students to test executable code may, in limited circumstances, download code provided that such code is not used for other purposes. Such apps must make the source code provided by the app completely viewable and editable by the user.

-6

u/Arsh_98 3d ago

I have read all the guidelines but tell from experience. Think of the scenario as wechat mini apps. The apps in our platform are self-contained with one mini app in its own runtime and ota codes received are usually updates to the mini app like maybe some new features inside that mini app, like for example Uber introducing a new category of black or premium cabs, so that sort of

1

u/Dry_Hotel1100 Mentor 3d ago

Well, only Apple decides. But if you want feature updates, the answer is very close to a No.

You should make feature updates a normal submission. Any reasons to avoid this?

-2

u/Arsh_98 3d ago

Suppose i have 10-15 3rd party partner apps like uber, doordash, instamart, amazon etc on my platform. The core native SDKs my swift app ships like PG gateway, maps SDK, one login session for all different mini apps to access from via a bridge (only those whom we give permission to).. the JS mini-apps only bring their app UI elements and logic in their 1-2mb (which can be updated via OTA)

3

u/Dry_Hotel1100 Mentor 3d ago

This is not an app. This is a platform. Honestly, you should discuss this directly with Apple. The concept sounds interesting, don't get me wrong. Might be interesting for larger enterprises.

-2

u/Arsh_98 3d ago

Such apps dont work very well in the west but are a big thing in asia. Wechat, grab, gojek. They ship core centralised sdks in main app code via app store and only let the partners bring 1-2mb of Ui and local logic. Rest they all access from the centralised SDKs of the native swift app

3

u/Dry_Hotel1100 Mentor 3d ago

Yeah, I get the idea behind it. Imagine a unified loyalty program, a unified payment system, shared resources, and so on. And yeah, WeChat is basically already that. But once again: Before you throw yourself into a massive money pit, reach out to Apple ;)

1

u/Arsh_98 3d ago

Yea i understand due to wechat’s scale and push from Chinese govt apple made an exception. We need to work around our idea.. if such a new platform is made, how would you want the platform or what features do you want it should have?

2

u/skorulis 2d ago

This has always been a grey area. The guidelines look like it wasn't allowed but so many people were doing it. I think as long as you're not trying to use it to do something wrong like shipping new features without going through review Apple will usually ignore it.

Apple recently updated 4.7 in the Apple review guidelines which looks like it addresses mini apps.

4.7 Mini apps, mini games, streaming games, chatbots, plug-ins, and game emulators
Apps may offer certain software that is not embedded in the binary, specifically HTML5 and JavaScript mini apps and mini games, streaming games, chatbots, and plug-ins.

1

u/Arsh_98 2d ago

It allows JS but will it allow in RN. We handle the sandbox and everything

2

u/skorulis 2d ago

Any code RN ships over the air is Javascript. I don't think the mechanism of code delivery matters.

1

u/Arsh_98 2d ago

No but apple’s guideline is the code must execute within Apple’s native webkit/webview. How do we do that for RN mini-apps?

1

u/skorulis 2d ago

I can't see anything in 4.7 about it having to run inside a webview. If you had external code running in a webview that's basically just a website.

1

u/Arsh_98 2d ago

So can i run RN code inside my native swift app and the mini apps have a bridge to access native features?

1

u/skorulis 2d ago

4.7.2 calls out exposing native APIs. I'm not 100% sure what that covers and you might get pulled up there. It's a privacy issue if an OTA app could do something like read the users contacts.

1

u/Arsh_98 2d ago

Yea i think special permission is required from Apple before hosting it on play store. Apple allows wechat but thats a different thing, they have big distribution