Skip to content

Commit 1d10dcd

Browse files
committed
Add AppDelegate implementation for CodePush integration
1 parent f472943 commit 1d10dcd

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import UIKit
2+
import React
3+
import React_RCTAppDelegate
4+
import ReactAppDependencyProvider
5+
import CodePush
6+
7+
@main
8+
class AppDelegate: RCTAppDelegate {
9+
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
10+
self.moduleName = "TestCodePush"
11+
self.dependencyProvider = RCTAppDependencyProvider()
12+
13+
// You can add your custom initial props in the dictionary below.
14+
// They will be passed down to the ViewController used by React Native.
15+
self.initialProps = [:]
16+
17+
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
18+
}
19+
20+
override func sourceURL(for bridge: RCTBridge) -> URL? {
21+
self.bundleURL()
22+
}
23+
24+
override func bundleURL() -> URL? {
25+
#if DEBUG
26+
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
27+
#else
28+
CodePush.bundleURL();
29+
#endif
30+
}
31+
}

0 commit comments

Comments
 (0)