Flutter Engine
FlutterPluginAppLifeCycleDelegate.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_
6 #define FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_
7 
8 #import "FlutterPlugin.h"
9 
11 
12 /**
13  * Propagates `UIAppDelegate` callbacks to registered plugins.
14  */
16 @interface FlutterPluginAppLifeCycleDelegate : NSObject
17 #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
18  <UNUserNotificationCenterDelegate>
19 #endif
20 
21 /**
22  * Registers `delegate` to receive life cycle callbacks via this FlutterPluginAppLifecycleDelegate
23  * as long as it is alive.
24  *
25  * `delegate` will only referenced weakly.
26  */
27 - (void)addDelegate:(NSObject<FlutterApplicationLifeCycleDelegate>*)delegate;
28 
29 /**
30  * Calls all plugins registered for `UIApplicationDelegate` callbacks.
31  *
32  * @return `NO` if any plugin vetoes application launch.
33  */
34 - (BOOL)application:(UIApplication*)application
35  didFinishLaunchingWithOptions:(NSDictionary*)launchOptions;
36 
37 /**
38  * Calls all plugins registered for `UIApplicationDelegate` callbacks.
39  *
40  * @return `NO` if any plugin vetoes application launch.
41  */
42 - (BOOL)application:(UIApplication*)application
43  willFinishLaunchingWithOptions:(NSDictionary*)launchOptions;
44 
45 /**
46  * Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
47  */
48 - (void)application:(UIApplication*)application
49  didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings
50  API_DEPRECATED(
51  "See -[UIApplicationDelegate application:didRegisterUserNotificationSettings:] deprecation",
52  ios(8.0, 10.0));
53 
54 /**
55  * Calls all plugins registered for `UIApplicationDelegate` callbacks.
56  */
57 - (void)application:(UIApplication*)application
58  didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken;
59 
60 /**
61  * Calls all plugins registered for `UIApplicationDelegate` callbacks.
62  */
63 - (void)application:(UIApplication*)application
64  didReceiveRemoteNotification:(NSDictionary*)userInfo
65  fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
66 
67 /**
68  * Calls all plugins registered for `UIApplicationDelegate` callbacks.
69  */
70 - (void)application:(UIApplication*)application
71  didReceiveLocalNotification:(UILocalNotification*)notification
72  API_DEPRECATED(
73  "See -[UIApplicationDelegate application:didReceiveLocalNotification:] deprecation",
74  ios(4.0, 10.0));
75 
76 /**
77  * Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until
78  * some plugin handles the request.
79  *
80  * @return `YES` if any plugin handles the request.
81  */
82 - (BOOL)application:(UIApplication*)application
83  openURL:(NSURL*)url
84  options:(NSDictionary<UIApplicationOpenURLOptionsKey, id>*)options;
85 
86 /**
87  * Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until
88  * some plugin handles the request.
89  *
90  * @return `YES` if any plugin handles the request.
91  */
92 - (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL*)url;
93 
94 /**
95  * Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until
96  * some plugin handles the request.
97  *
98  * @return `YES` if any plugin handles the request.
99  */
100 - (BOOL)application:(UIApplication*)application
101  openURL:(NSURL*)url
102  sourceApplication:(NSString*)sourceApplication
103  annotation:(id)annotation;
104 
105 /**
106  * Calls all plugins registered for `UIApplicationDelegate` callbacks.
107  */
108 - (void)application:(UIApplication*)application
109  performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem
110  completionHandler:(void (^)(BOOL succeeded))completionHandler
111  API_AVAILABLE(ios(9.0));
112 
113 /**
114  * Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until
115  * some plugin handles the request.
116  *
117  * @return `YES` if any plugin handles the request.
118  */
119 - (BOOL)application:(UIApplication*)application
120  handleEventsForBackgroundURLSession:(nonnull NSString*)identifier
121  completionHandler:(nonnull void (^)(void))completionHandler;
122 
123 /**
124  * Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until
125  * some plugin handles the request.
126  *
127  * @returns `YES` if any plugin handles the request.
128  */
129 - (BOOL)application:(UIApplication*)application
130  performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
131 
132 /**
133  * Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until
134  * some plugin handles the request.
135  *
136  * @return `YES` if any plugin handles the request.
137  */
138 - (BOOL)application:(UIApplication*)application
139  continueUserActivity:(NSUserActivity*)userActivity
140  restorationHandler:(void (^)(NSArray*))restorationHandler;
141 @end
142 
144 
145 #endif // FLUTTER_FLUTTERPLUGINAPPLIFECYCLEDELEGATE_H_
#define NS_ASSUME_NONNULL_END
Definition: FlutterMacros.h:20
#define NS_ASSUME_NONNULL_BEGIN
Definition: FlutterMacros.h:19
#define FLUTTER_EXPORT