From e4fb9966e762852bf17f21c8406501d42fae0b61 Mon Sep 17 00:00:00 2001 From: hc Date: Fri, 10 Apr 2026 17:39:12 +0800 Subject: Initial commit: iHealth BLE scanner app with patched SDK v1.5.0 --- ios/iHealthScanner/AppDelegate.swift | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 ios/iHealthScanner/AppDelegate.swift (limited to 'ios/iHealthScanner/AppDelegate.swift') diff --git a/ios/iHealthScanner/AppDelegate.swift b/ios/iHealthScanner/AppDelegate.swift new file mode 100644 index 0000000..b27dd5a --- /dev/null +++ b/ios/iHealthScanner/AppDelegate.swift @@ -0,0 +1,48 @@ +import UIKit +import React +import React_RCTAppDelegate +import ReactAppDependencyProvider + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + var window: UIWindow? + + var reactNativeDelegate: ReactNativeDelegate? + var reactNativeFactory: RCTReactNativeFactory? + + func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil + ) -> Bool { + let delegate = ReactNativeDelegate() + let factory = RCTReactNativeFactory(delegate: delegate) + delegate.dependencyProvider = RCTAppDependencyProvider() + + reactNativeDelegate = delegate + reactNativeFactory = factory + + window = UIWindow(frame: UIScreen.main.bounds) + + factory.startReactNative( + withModuleName: "iHealthScanner", + in: window, + launchOptions: launchOptions + ) + + return true + } +} + +class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate { + override func sourceURL(for bridge: RCTBridge) -> URL? { + self.bundleURL() + } + + override func bundleURL() -> URL? { +#if DEBUG + RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") +#else + Bundle.main.url(forResource: "main", withExtension: "jsbundle") +#endif + } +} -- cgit