Skip to content

Latest commit

 

History

History
89 lines (69 loc) · 4.72 KB

File metadata and controls

89 lines (69 loc) · 4.72 KB

Miscellaneous stuff

We'll be put interesting stuff up here as it comes up right before or during the workshop

Module 01

EAS Build: also an option!

The same concepts we covered about when to run prebuild / npx expo run:ios|android also applies to when we could run EAS Build. We want to build locally today, especially later, because we'll be iterating on native features. But you could actually get through module 3 with just one build on EAS Build:

  1. run npm install -g eas-cli to install the EAS CLI
  2. run eas build:configure to setup your project. Login/ create an Expo account if you don't already have one.
  3. Follow the directions onscreen to add the projectId to app.json.
  4. Run eas build --profile development --platform ios|android. This will make a build you can drag to your Android emulator / iOS simulator

This wouldn't scale well to the iOS widget creation part of Module 5... there's just too much native code iteration going on.

Other workshop

Module 02

Module 03

Module 04

(tabs)/_layout.tsx: add lazy: true to options to make the back routing work from a cold start.

<Tabs
      screenOptions={{
        headerShown: false,
        tabBarHideOnKeyboard: true,
        tabBarStyle: [$tabBar, { height: bottom + 70 }],
        tabBarActiveTintColor: colors.text,
        tabBarInactiveTintColor: colors.text,
        tabBarLabelStyle: $tabBarLabel,
        tabBarItemStyle: $tabBarItem,
+        lazy: false
      }}
    >

This is needed because the routing messes up due to all the tabs not being loaded at start. This is why lazy tab loading often makes me upset :).

Module 05

Notes about building signed apps with widget extensions for iOS

We're using simulators and ignoring Apple teams and provisioning profiles fow now to keep things simple, focusing on the feature itself. However, for an actual production version (or even an ad-hoc testing version), you'll need real Apple signing stuff for both your main app and the app extension.

You'll notice we skipped on setting the "development team" in the iOS plugin code. If you set that, it'll assign the correct development team for the extension.

EAS Build will automatically apply your credentials for your main app, but doesn't automatically know to do that for your app extension. However, there is a secret property that can help with this. Set this in the extra in your app config:

"eas": {
  "build": {
    "experimental": {
      "ios": {
        "appExtensions": [
          {
            "bundleIdentifier": "com.expo.appjs24-workflows-workshop",
            "targetName": "HelloWidget",
            "entitlements": {
              "com.apple.security.application-groups": ["group.appjs24-workflows-workshop"]
            }
          }
        ]
      }
    }
  }
}

Making Xcode widget preview not take forever to load (partial)

The concept (haven't verified this yet)

  1. Create a Prebuild template without the React Native cocoapods linked
  2. Use that template when running prebuild
  3. Open Xcode
  4. Work on your widget swift file with live preview.

One part: how to create an alternative template for prebuild

Other