Skip to content

iOS AppDelegate mod does nothing on Expo SDK 53+ and does not say so #30

Description

@GSTJ

withIosAppDelegateDependency looks for these Objective-C strings:

#import "AppDelegate.h"
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];

Expo SDK 53 moved the template to Swift, so neither is in the file. SDK 50 through 52 still ship AppDelegate.mm and still match. Both edits go through helpers that call String.replace with a missing needle, which returns the string unchanged, so prebuild reports success and writes nothing.

On a blank SDK 57 app with the plugin configured, ios/<app>/Info.plist gets CodePushDeploymentKey and CodePushServerURL, and ios/<app>/AppDelegate.swift comes out identical to the template. grep -r CodePush ios/ finds only the plist. The app runs against the bundle baked into the IPA and never asks CodePush where the bundle is, which surfaces as "CodePush isn't updating anything".

What the mod would have to touch on SDK 57:

class ReactNativeDelegate: ExpoReactNativeFactoryDelegate {
  // Extension point for config-plugins

  override func bundleURL() -> URL? {
#if DEBUG
    return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: ".expo/.virtual-metro-entry")
#else
    return Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
  }
}

The release branch is what needs to become CodePush.bundleURL(). That's a Swift call into an Objective-C SDK, so it also needs #import <CodePush/CodePush.h> in <app>-Bridging-Header.h, which the template generates empty. The // Extension point for config-plugins comment sitting in that class looks like the intended anchor.

Worth deciding at the same time whether the mod should throw. Android throws when it can't find an anchor, which is how #26 got noticed. iOS failing quietly is why this one sat unreported. Whatever the fix is, the not-found path should be loud.

Android is fixed in #28.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions