Expo Config Plugin that generates an App Clip for iOS apps built with Expo.

Overview

react-native-app-clip

Expo Config Plugin that generates an App Clip for iOS apps built with Expo.

Warning This plugin is a work in progress and hasn’t been adequately tested in the wild. I made the repository public to gather feedback and ask for help. Don’t use this plugin in production just yet!

Installation

Install it in your project:

expo install react-native-app-clip

In your app’s Expo config (app.json, or app.config.js), make sure that react-native-app-clip has been added to the list of plugins. You may optionally provide a name option, which will determine the display name of your App Clip in iOS. If you do not provide a value here, it will be your app’s name appended with " Clip".

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

Determining what the App Clip renders

The App Clip will render the same root component as the full app ("App.tsx" by default). The root component will receive a boolean prop named "isClip" that is true for the App Clip. Using this prop, you can make different rendering decisions within the app. For example:

export default function App({ isClip }: { isClip: boolean }) {
  console.log("isClip", isClip);

  return (
    <SafeAreaProvider>
      {isClip ? <AppClip /> : <Navigation />}
      <StatusBar />
    </SafeAreaProvider>
  );
}

Before building for the App Store

Please note that you must register a new App ID for the App Clip in your Apple Developer profile. Under "Certificates, Identifiers & Profiles", go to “Identifiers”, click on the plus icon and select "App IDs" to create a new App ID. Select "App Clip" as the type and on the next screen, select your main app as the "Parent App ID" and enter Clip as the product name (it is crucial that the product name is "Clip" and nothing else. At the bottom of the page, Apple shows a preview of the App Clip Bundle ID. If your main app’s bundle ID is com.example.my-app, the App Clip Bundle ID should now be com.example.my-app.Clip.

How to test the App Clip

App Clips can not be tested with Expo Go or expo-dev-client. The best two ways to test the App Clip seem to be the following:

Run in Simulator

Build the development client first by running expo run:ios and opening the app in Simulator. After doing this once, you can run expo run:ios --scheme and select the App Clip scheme ("...Clip") to open the App Clip. You could also add an extra script to your project’s package.json:

"scripts": {
  "clip": "expo run:ios --scheme my-appClip"
}

Now you can simply type "npm run clip" in your terminal to open the App Clip.

Build App Clip with Xcode and open on a connected device

Run expo prebuild -p ios (see https://docs.expo.dev/workflow/expo-cli/#expo-prebuild) in your Expo project folder to generate the ios folder with all native sources. Then open the file ios/my-app.xcworkspace (with my-app being your app’s name) in Xcode. In your project, you should find two targets, one named like your app (e.g. "my-app") and one with a "Clip" suffix (e.g. "my-appClip"). For both targets, select a team in the "Signing & Capabilities" tab and make sure a signing certificate is selected by Xcode. Then, using the menu bar, select "Product", followed by "Scheme", where you should see two themes listed at the bottom of the menu, named after the two targets. Select the scheme that ends with "Clip". Now you can build and run the App Clip (using the menu bar via "Product" followed by "Run" or using the shortcut ⌘R).

Build for production using EAS Build and test via TestFlight

You can build your app and submit it to the App Store (see https://docs.expo.dev/build/introduction/) to test the App Clip using TestFlight. Refer to Apple’s developer docs about testing App Clips: https://developer.apple.com/documentation/app_clips/testing_the_launch_experience_of_your_app_clip.

Comments
  • Question about the bundle identifier

    Question about the bundle identifier

    First off, wow! I've been wanting this for so long. So excited to try it.

    Question: I use react-native-firebase in my app. As part of the setup on Firebase's website, I need to tell it my bundle identifier.

    How would this work with the app clips? Does the app clip have a separate bundle identifier, or do you think firebase would still work it the identifier of the main app?

    Thanks so much!

    opened by nandorojo 2
  • Is the resulting AppClip from a fresh Expo project really 15.4MB? Any way to reduce its size?

    Is the resulting AppClip from a fresh Expo project really 15.4MB? Any way to reduce its size?

    Hey, great work on this library!

    I just tried it with a fresh Expo project (as demoed in your presentation video https://www.youtube.com/watch?v=RO6tLuAitPo).

    However after building it I have 2 files: clipper - 30.9MB clipper Clip - 15.4MB

    Since the size limit for AppClips is 10MB (soon 15MB for iOS 16), what's the idea here? What exactly can be shaved down from the base Expo project such that it goes below the size limit?

    Thanks

    opened by iuliuvisovan 1
  • Skipping Dependencies For App Clip Target

    Skipping Dependencies For App Clip Target

    Hi, first of all - thank you so much for creating this config-plugin!

    I have been able to build an app clip for my Expo app with it. However, I am over the accepted size limit.

    Have you been able to remove certain dependencies for the app clip target? For example, an npm package that the main app uses and the app clip does not.

    At the moment my app clip shares all the same dependencies as the main project.

    opened by Ross-Landry 5
  • There doesn't seem to be a way to start app clips from the command line yet

    There doesn't seem to be a way to start app clips from the command line yet

    npx expo run:ios --scheme cardClip

    gives the following warning and starts the app, not app clips

    ios: paths-app-delegate: Found multiple AppDelegate file paths, using "ios/card/AppDelegate.mm". Ignored paths: ["ios/cardClip/AppDelegate.mm"]
    
    ios: paths-info-plist: Found multiple Info.plist file paths, using "ios/card/Info.plist". Ignored paths: ["ios/cardClip/Info.plist"]
    
    opened by gaodeng 1
  • EAS Build Failed

    EAS Build Failed

    The EAS Build is failing with the following error: Could not find target '....Clip' in project.pbxproj Do I need to eject the project in order to make the App Clip work?

    I actually followed your instructions in the README, except for the prebuild step, because I haven't ejected the app.

    bug 
    opened by mariomurrent-softwaresolutions 9
  • 🚀 Suggestions

    🚀 Suggestions

    Great work on this plugin, I'm ecstatic about the progress so far! Below I've outlined some things that you can use (or ignore).

    Entry Point

    Two possible approaches:

    • Custom static entry point like index.clip.js -- this is similar to how React Native used to work with a different index.android.js, and index.ios.js.
    • Reuse the default entry point and expose some value like Platform.isAppClip to export a different default component. This is more akin to how universal React works now.

    App Icon

    We should expose the upstream plugin in @expo/config-plugins but since we don't, you can use this to get all of the dynamic values we support in the app.json icon property (resizing, urls, caching between runs, etc).

    Entitlements

    Here is an example of adding a safe modifier for the entitlements file, this is good because it means users can easily extend or add values to the template you provide. I also do the same with the custom Info.plist. Ultimately this will scale nicely and help end-users.

    It can be used like this.

    Further, I recommend using this static value $(AppIdentifierPrefix)$(CFBundleIdentifier) for com.apple.developer.parent-application-identifiers so users can more easily change the bundle identifier. Apple automatically expands this value during code signing. Ref: used this to simplify some other plugins.

    Accent Color

    Here's an example for adding the accent color the color getter probably doesn't work. For that you can try this helper from react-xib.

    Name / Defaults

    Docs

    We added support for running app clips with expo run:ios --scheme a few months ago so this should make development a bit easier. If you find an issue with this workflow please let me know, Xcode is no fun.


    Again, great work! Excited to follow the progress of this project!

    enhancement 
    opened by EvanBacon 7
Releases(v0.0.33)
Boilerplate to build Cross-Platform Apps with Expo and React Native

Expo and React Native Boilerplate Boilerplate to build Cross-Platform Apps with Expo and React Native What are you going to find in this boilerplate E

José Ferrer 26 Apr 29, 2022
A zero-config toolkit for creating fine Forge apps

A zero-config toolkit for creating fine Forge apps. Background The Forge Dev Kit (FDK) is a preconfigured set of libraries and frameworks for developi

Fine Software 17 Aug 10, 2022
🎉 toastify-react-native allows you to add notifications to your react-native app (ios, android) with ease. No more nonsense!

toastify-react-native ?? toastify-react-native allows you to add notifications to your react-native app (ios, android) with ease. No more nonsense! De

Zahid Ali 29 Oct 11, 2022
A simple example on how to get WalletConnect to authenticate wallets in the Expo Go app.

WalletConnect Example on Expo This is a simple example how to get WalletConnect up and running with Expo for React Native. WalletConnect's dependency

Carlos A. Wong 60 Dec 30, 2022
A lite version for the my original app loki stream which allowed watching anime on your phone. Made using expo.

LokiStream Lite A lite version for the my original app loki stream. This app is faster, smaller and more optimized for your phone. It allows you to wa

Lavish Kumar 18 Dec 24, 2022
Vtexio-react-apps - Apps react para plafaforma VTEX.

Projeto Modal + Apps Extras Projeto modal setando cookies. Desenvolvido em React + TypeScript para aplicação em e-commerce VTEXIO. ?? Este projeto se

Marcelo 1 Jan 3, 2022
The Power CAT code components are a set of Power Apps component framework (PCF) controls that can be used to enhance power apps.

Power CAT code components The Power CAT code components are a set of Power Apps component framework (PCF) controls that can be used to enhance power a

Microsoft 70 Jan 2, 2023
You can use this CLI Tool to clean your iOS and Android projects and keep them updated.

Mobile App Cleaner You can use this CLI Tool to clean your iOS and Android projects and keep them updated. This tool automatizes these items below; Cl

automizer 21 Mar 19, 2022
frida runtime (no python required, only a single file),One-click support for ios smashing shell

fd 简要介绍 要是你看不懂中文可以使用chrome翻译功能 frida 运行时(不需要python,只有单一个文件) fd 使用fd前请确认手机上有frida-server a brief introdction English can use chrome translation frida r

null 181 Dec 30, 2022
Simple React Native marquee component,fully implemented using reanimated v2,support to iOS/Android/Web.

@react-native-reanimated-community/react-native-reanimated-marquee Simple React Native marquee component,fully implemented using reanimated v2,support

react-native-reanimated-community 6 Sep 25, 2022
WPPConnect/mobile is an open source project with the objective of automating whatsapp web using the android or ios mobile browser and being able to perform all the functions of our wa-js project

WPPConnect/mobile is an open source project with the objective of automating whatsapp web using the android or ios mobile browser and being able to perform all the functions of our wa-js project, so it is possible to create a customer service, media sending, intelligence recognition based on artificial phrases and many other things, use your imagination to change and modify this project or collaborate on improvements...

null 11 Dec 28, 2022
React Native & Expo music player application UI

Would you like to support me? Musicont React Native & Expo music player application UI Demo: https://expo.io/@jsxclan/musicont APK: Download on Google

JSX Clan 82 Dec 14, 2022
Our Expo-based mobile application for demonstration purposes.

Capable Care reference implementation This repository provides a working example of a React Native mobile application (built on Expo) integrating Capa

Capable Health 11 Oct 1, 2022
Tamagui with Supabase, Expo, Next.js, Solito and Jotai

Tamagui + Supabase + Solito + Next + Expo Monorepo ⚡️ Instant clone & deploy ?? About This monorepo is a starter todo app, built using Supabase + Expo

Lachlan Hawthorne 15 Dec 12, 2022
Convert a CSS linear gradient function to expo-linear-gradient props

@bacons/css-to-expo-linear-gradient Demo: snack Convert a CSS linear gradient function to expo-linear-gradient props. Add the package to your npm depe

Evan Bacon 15 Dec 15, 2022
An easy hook to use with expo-calendar library!

useCalendar Hook ?? Updated to Expo SDK45 This is an easy hook to use expo-calendar. It allows you: Get access permission to calendar Open settings to

AtilaDev 12 Nov 1, 2022
Expo Demo: Screen Capture with Managed Workflow

Expo Demo: Screen Capture with Managed Workflow This code demonstrates how to setup screen capture on an Expo app, without having to eject from the ma

Luis Taniça 12 Dec 30, 2022
A new renovated version of Directory to search @expo-google-fonts

Directory | AtilaDev Directory is an easy & quick search to find google fonts using @expo-google-fonts for your React Native App. Usage Press / key to

Leandro Favre 2 Oct 5, 2022
⚡ Zero config GUI for Jest

Majestic is a GUI for Jest ✅ Run all the tests or a single file ⏱ Toggle watch mode ?? Update snapshots ❌ Examine test failures as they happen ⏲ Conso

Raathi Kugarajan 7.4k Jan 2, 2023