Files
ppc_amnet/amnet-native/patches/expo-modules-core+1.12.20.patch
T

65 lines
2.5 KiB
Diff

diff --git a/node_modules/expo-modules-core/ios/AppDelegates/ExpoAppDelegate.swift b/node_modules/expo-modules-core/ios/AppDelegates/ExpoAppDelegate.swift
index 8ba09a7..8d7d2b0 100644
--- a/node_modules/expo-modules-core/ios/AppDelegates/ExpoAppDelegate.swift
+++ b/node_modules/expo-modules-core/ios/AppDelegates/ExpoAppDelegate.swift
@@ -101,59 +101,6 @@ open class ExpoAppDelegate: UIResponder, UIApplicationDelegate {
}
}
- // MARK: - Handling Remote Notification Registration
-
- open func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
- subscribers.forEach { $0.application?(application, didRegisterForRemoteNotificationsWithDeviceToken: deviceToken) }
- }
-
- open func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
- subscribers.forEach { $0.application?(application, didFailToRegisterForRemoteNotificationsWithError: error) }
- }
-
- open func application(
- _ application: UIApplication,
- didReceiveRemoteNotification userInfo: [AnyHashable: Any],
- fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
- ) {
- let selector = #selector(application(_:didReceiveRemoteNotification:fetchCompletionHandler:))
- let subs = subscribers.filter { $0.responds(to: selector) }
- var subscribersLeft = subs.count
- let dispatchQueue = DispatchQueue(label: "expo.application.remoteNotification", qos: .userInteractive)
- var failedCount = 0
- var newDataCount = 0
-
- let handler = { (result: UIBackgroundFetchResult) in
- dispatchQueue.sync {
- if result == .failed {
- failedCount += 1
- } else if result == .newData {
- newDataCount += 1
- }
-
- subscribersLeft -= 1
-
- if subscribersLeft == 0 {
- if newDataCount > 0 {
- completionHandler(.newData)
- } else if failedCount > 0 {
- completionHandler(.failed)
- } else {
- completionHandler(.noData)
- }
- }
- }
- }
-
- if subs.isEmpty {
- completionHandler(.noData)
- } else {
- subs.forEach { subscriber in
- subscriber.application?(application, didReceiveRemoteNotification: userInfo, fetchCompletionHandler: handler)
- }
- }
- }
-
// MARK: - Continuing User Activity and Handling Quick Actions
open func application(_ application: UIApplication, willContinueUserActivityWithType userActivityType: String) -> Bool {