Skip to content

Commit 3a22996

Browse files
committed
cleanup ios
1 parent 0f0aaa6 commit 3a22996

6 files changed

Lines changed: 113 additions & 580 deletions

File tree

ios/Expo/ExpoPushyReactDelegateHandler.swift

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,19 @@ import ExpoModulesCore
22
import React
33

44
public 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
}

ios/ImportReact.h

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)