@@ -2,39 +2,19 @@ import ExpoModulesCore
22import React
33
44public final class ExpoPushyReactDelegateHandler : ExpoReactDelegateHandler {
5+ private func resolvedBundleURL( ) -> URL ? {
6+ RCTPushy . bundleURL ( )
7+ }
58
69 #if EXPO_SUPPORTS_BUNDLEURL
7- // This code block compiles only if EXPO_SUPPORTS_BUNDLEURL is defined
8- // For expo-modules-core >= 1.12.0
9-
10- // Override bundleURL, which is the primary mechanism for these versions.
11- // Expo's default createBridge implementation should respect this.
1210 override public func bundleURL( reactDelegate: ExpoReactDelegate ) -> URL ? {
13- let bundleURL = RCTPushy . bundleURL ( )
14- print ( " PushyHandler: Using bundleURL: \( bundleURL? . absoluteString ?? " nil " ) " )
15- return bundleURL
11+ resolvedBundleURL ( )
1612 }
1713
18- // No createBridge override needed here, rely on default behavior using the bundleURL override.
19-
2014 #else
21- // This code block compiles only if EXPO_SUPPORTS_BUNDLEURL is NOT defined
22- // For expo-modules-core < 1.12.0
23-
24- // No bundleURL override possible here.
25-
26- // createBridge is the mechanism to customize the URL here.
27- // We completely override it and do not call super.
2815 override public func createBridge( reactDelegate: ExpoReactDelegate , bridgeDelegate: RCTBridgeDelegate , launchOptions: [ AnyHashable : Any ] ? ) -> RCTBridge ? {
29- let bundleURL = RCTPushy . bundleURL ( )
30- // Print the URL being provided to the initializer
31- print ( " PushyHandler: createBridge bundleURL: \( bundleURL? . absoluteString ?? " nil " ) " )
32-
33- // Directly create the bridge using the bundleURL initializer.
34- // Pass nil for moduleProvider, assuming default behavior is sufficient.
35- // WARNING: If bundleURL is nil, this initialization might fail silently or crash.
36- return RCTBridge ( bundleURL: bundleURL, moduleProvider: nil , launchOptions: launchOptions)
16+ RCTBridge ( bundleURL: resolvedBundleURL ( ) , moduleProvider: nil , launchOptions: launchOptions)
3717 }
3818
39- #endif // EXPO_SUPPORTS_BUNDLEURL
19+ #endif
4020}
0 commit comments