Skip to content

Commit 7f99556

Browse files
committed
fix: revert swift changes too
1 parent ed93430 commit 7f99556

File tree

1 file changed

+13
-31
lines changed

1 file changed

+13
-31
lines changed

examples/SampleApp/ios/AppDelegate.swift

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,24 @@ import FirebaseCore
66
import FirebaseMessaging
77

88
@main
9-
class AppDelegate: UIResponder, UIApplicationDelegate {
10-
var window: UIWindow?
11-
12-
var reactNativeDelegate: ReactNativeDelegate?
13-
var reactNativeFactory: RCTReactNativeFactory?
14-
15-
func application(
16-
_ application: UIApplication,
17-
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
18-
) -> Bool {
19-
let delegate = ReactNativeDelegate()
20-
let factory = RCTReactNativeFactory(delegate: delegate)
21-
delegate.dependencyProvider = RCTAppDependencyProvider()
22-
FirebaseApp.configure()
23-
24-
reactNativeDelegate = delegate
25-
reactNativeFactory = factory
26-
27-
window = UIWindow(frame: UIScreen.main.bounds)
28-
29-
factory.startReactNative(
30-
withModuleName: "SampleApp",
31-
in: window,
32-
launchOptions: launchOptions
33-
)
34-
35-
return true
36-
}
9+
class AppDelegate: RCTAppDelegate {
10+
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
11+
self.moduleName = "SampleApp"
12+
self.dependencyProvider = RCTAppDependencyProvider()
13+
FirebaseApp.configure()
3714

38-
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
15+
// You can add your custom initial props in the dictionary below.
16+
// They will be passed down to the ViewController used by React Native.
17+
self.initialProps = [:]
18+
19+
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
20+
}
21+
22+
override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
3923
// Pass the device token to FCM
4024
Messaging.messaging().apnsToken = deviceToken
4125
}
42-
}
4326

44-
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
4527
override func sourceURL(for bridge: RCTBridge) -> URL? {
4628
self.bundleURL()
4729
}

0 commit comments

Comments
 (0)