@@ -3,7 +3,6 @@ import Combine
33import Storage
44import class Networking. UserAgent
55import Experiments
6- import class WidgetKit. WidgetCenter
76import protocol WooFoundation. Analytics
87import protocol Yosemite. StoresManager
98import struct Yosemite. Site
@@ -146,46 +145,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
146145 await ServiceLocator . pushNotesManager. handleRemoteNotificationInTheBackground ( userInfo: userInfo)
147146 }
148147
149- func application( _ application: UIApplication , performActionFor shortcutItem: UIApplicationShortcutItem , completionHandler: @escaping ( Bool ) -> Void ) {
150- guard let quickAction = QuickAction ( rawValue: shortcutItem. type) ,
151- let tabBarController else {
152- completionHandler ( false )
153- return
154- }
155- switch quickAction {
156- case QuickAction . addProduct:
157- MainTabBarController . presentAddProductFlow ( )
158- completionHandler ( true )
159- case QuickAction . addOrder:
160- tabBarController. navigate ( to: OrdersDestination . createOrder)
161- completionHandler ( true )
162- case QuickAction . openOrders:
163- tabBarController. navigate ( to: OrdersDestination . orderList)
164- completionHandler ( true )
165- case QuickAction . collectPayment:
166- tabBarController. navigate ( to: OrdersDestination . createOrder)
167- completionHandler ( true )
168- }
169- }
170-
171148 func applicationWillTerminate( _ application: UIApplication ) {
172149 DDLogVerbose ( " 👀 Application terminating... " )
173150 NotificationCenter . default. post ( name: . applicationTerminating, object: nil )
174151 }
175152
176- func application( _ application: UIApplication ,
177- continue userActivity: NSUserActivity ,
178- restorationHandler: @escaping ( [ UIUserActivityRestoring ] ? ) -> Void ) -> Bool {
179- if userActivity. activityType == NSUserActivityTypeBrowsingWeb {
180- UIApplication . sceneDelegate? . handleWebActivity ( userActivity)
181- }
182-
183- SpotlightManager . handleUserActivity ( userActivity)
184- trackWidgetTappedIfNeeded ( userActivity: userActivity)
185-
186- return true
187- }
188-
189153 func applicationDidReceiveMemoryWarning( _ application: UIApplication ) {
190154 let size = os_proc_available_memory ( )
191155 DDLogDebug ( " Received memory warning: Available memory - \( size) " )
@@ -223,9 +187,6 @@ extension AppDelegate {
223187 UINavigationBar . applyWooAppearance ( )
224188 UILabel . applyWooAppearance ( )
225189 UITabBar . applyWooAppearance ( )
226-
227- // Take advantage of a bug in UIAlertController to style all UIAlertControllers with WC color
228- UIApplication . wooKeyWindow? . tintColor = . primary
229190 }
230191
231192 /// Sets up FancyAlert's UIAppearance.
@@ -399,20 +360,6 @@ extension AppDelegate {
399360 func reconnectToTapToPayReaderIfNeeded( ) {
400361 ServiceLocator . tapToPayReconnectionController. reconnectIfNeeded ( )
401362 }
402-
403- /// Tracks if the application was opened via a widget tap.
404- ///
405- func trackWidgetTappedIfNeeded( userActivity: NSUserActivity ) {
406- switch userActivity. activityType {
407- case WooConstants . storeInfoWidgetKind:
408- let widgetFamily = userActivity. userInfo ? [ WidgetCenter . UserInfoKey. family] as? String
409- ServiceLocator . analytics. track ( event: . Widgets. widgetTapped ( name: . todayStats, family: widgetFamily) )
410- case WooConstants . appLinkWidgetKind:
411- ServiceLocator . analytics. track ( event: . Widgets. widgetTapped ( name: . appLink) )
412- default :
413- break
414- }
415- }
416363}
417364
418365
0 commit comments