bndkt

Automatically adding an App Clip to a React Native iOS App

2 min readDevelopment

I’m currently working on an iOS app that would benefit significantly from having an App Clip - that is, users could leverage parts of its functionality without even installing the app.

The app is built with React Native using Expo, which is fantastic because I get to leverage my TypeScript skills and can (almost) ignore the fact that I don’t know the first thing about native iOS development.

Expo/React Native, however, used to hit a limit when it comes to capabilities that require modification of native code, and adding an App Clip requires you to do just that. App Clips require a host of changes to native code, including entitlements, an additional native target with a separate bundle identifier, and more. Luckily, Expo introduced the option to modify (or should I say "mess with") native code using Expo Config Plugins a while ago. As there is no plugin for App Clips yet (and I think now I know why - it’s pretty complicated!), I set out to build one myself.

Today, I’m happy to make this plugin available for everyone to use so that many Expo apps out there can use the App Clip capability on iOS. Bear in mind it is the first iteration, so use it with care and expect that there will be further improvements required, and you might encounter bugs. I’m publishing this now to gather feedback and be able to ask for help.

The source can be found on GitHub, and the plugin is available to install from NPM. To add it to your Expo app, just run

npx expo install react-native-app-clip

and make sure the following configuration has been added to your app.json automatically:

"expo": {
  "name": "my-app",
  "plugins": [
      ["react-native-app-clip"]
  ]
}

I was able to build and submit an app using the plugin with EAS Build/Submit and test it with TestFlight. For a very basic app (just one screen in the App Clip), the App Clip size was 3.26 MB, so there should be a lot of room to add app functionality before hitting the 10 MB limit of App Clips (which will be raised to 15 MB with iOS 16).

If you have any issues, find a bug or have general feedback, please open an issue in the GitHub repository. This is my first Open Source contribution, and I want to thank Evan Bacon for pointing me in the right direction and providing a lot of helpful content and examples that I built upon when creating this plugin.