| Flutter iOS Embedder |

Instance Methods | List of all members
FlutterPluginAppLifeCycleDelegate Class Reference

`#import <FlutterPluginAppLifeCycleDelegate.h>`

Inheritance diagram for FlutterPluginAppLifeCycleDelegate:

## Instance Methods
(void) | - addDelegate:
(BOOL) | - application:didFinishLaunchingWithOptions:
(BOOL) | - application:willFinishLaunchingWithOptions:
(void) | - application:didRegisterUserNotificationSettings:
(void) | - application:didRegisterForRemoteNotificationsWithDeviceToken:
(void) | - application:didFailToRegisterForRemoteNotificationsWithError:
(void) | - application:didReceiveRemoteNotification:fetchCompletionHandler:
(void) | - application:didReceiveLocalNotification:
(BOOL) | - application:openURL:options:
(BOOL) | - application:handleOpenURL:
(BOOL) | - application:openURL:sourceApplication:annotation:
(void) | - application:performActionForShortcutItem:completionHandler:
(BOOL) | - application:handleEventsForBackgroundURLSession:completionHandler:
(BOOL) | - application:performFetchWithCompletionHandler:
(BOOL) | - application:continueUserActivity:restorationHandler:

## Detailed Description

Propagates `UIAppDelegate` callbacks to registered plugins.

Definition at line 16 of file FlutterPluginAppLifeCycleDelegate.h.

## Method Documentation

## ◆ addDelegate:

- (void) addDelegate: |  | (NSObject<FlutterApplicationLifeCycleDelegate>*) | delegate |

Registers `delegate` to receive life cycle callbacks via this FlutterPluginAppLifeCycleDelegate as long as it is alive.

`delegate` will only be referenced weakly.

Definition at line 66 of file FlutterPluginAppLifeCycleDelegate.mm.

91 :(NSObject<FlutterApplicationLifeCycleDelegate>*)delegate {
92 [_delegates addPointer:(__bridge void*)delegate];
93 if (IsPowerOfTwo([_delegates count])) {
94 [_delegates compact];
95 }
96 }
_delegates
NSPointerArray * _delegates
Definition: FlutterPluginAppLifeCycleDelegate.mm:33

## ◆ application:continueUserActivity:restorationHandler:

- (BOOL) application: |  | (UIApplication*) | application
continueUserActivity: |  | (NSUserActivity*) | userActivity
restorationHandler: |  | (void(^)(NSArray*)) | restorationHandler

Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles the request.

Returns
  `YES` if any plugin handles the request.

Definition at line 66 of file FlutterPluginAppLifeCycleDelegate.mm.

417 :(UIApplication*)application
418 continueUserActivity:(NSUserActivity*)userActivity
419 restorationHandler:(void (^)(NSArray*))restorationHandler {
420 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
421 if (!delegate) {
422 continue;
423 }
424 if ([delegate respondsToSelector:_cmd]) {
425 if ([delegate application:application
426 continueUserActivity:userActivity
427 restorationHandler:restorationHandler]) {
428 return YES;
429 }
430 }
431 }
432 return NO;
433 }

## ◆ application:didFailToRegisterForRemoteNotificationsWithError:

- (void) application: |  | (UIApplication*) | application
didFailToRegisterForRemoteNotificationsWithError: |  | (NSError*) | error

Calls all plugins registered for `UIApplicationDelegate` callbacks.

Definition at line 66 of file FlutterPluginAppLifeCycleDelegate.mm.

248 :(UIApplication*)application
249 didFailToRegisterForRemoteNotificationsWithError:(NSError*)error {
250 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
251 if (!delegate) {
252 continue;
253 }
254 if ([delegate respondsToSelector:_cmd]) {
255 [delegate application:application didFailToRegisterForRemoteNotificationsWithError:error];
256 }
257 }
258 }

## ◆ application:didFinishLaunchingWithOptions:

- (BOOL) application: |  | (UIApplication*) | application
didFinishLaunchingWithOptions: |  | (NSDictionary*) | launchOptions

Calls all plugins registered for `UIApplicationDelegate` callbacks.

Returns
  `NO` if any plugin vetos application launch.

Definition at line 66 of file FlutterPluginAppLifeCycleDelegate.mm.

98 :(UIApplication*)application
99 didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
100 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in [_delegates allObjects]) {
101 if (!delegate) {
102 continue;
103 }
104 if ([delegate respondsToSelector:_cmd]) {
105 if (![delegate application:application didFinishLaunchingWithOptions:launchOptions]) {
106 return NO;
107 }
108 }
109 }
110 return YES;
111 }

## ◆ application:didReceiveLocalNotification:

- (void) application: |  | (UIApplication *) | application
didReceiveLocalNotification: |  | ("See - deprecation") | [UIApplicationDelegate application:didReceiveLocalNotification:]
|  | (ios(4.0, 10.0)) | API_DEPRECATED

Calls all plugins registered for `UIApplicationDelegate` callbacks.

## ◆ application:didReceiveRemoteNotification:fetchCompletionHandler:

- (void) application: |  | (UIApplication*) | application
didReceiveRemoteNotification: |  | (NSDictionary*) | userInfo
fetchCompletionHandler: |  | (void(^)(UIBackgroundFetchResult result)) | completionHandler

Calls all plugins registered for `UIApplicationDelegate` callbacks.

Definition at line 66 of file FlutterPluginAppLifeCycleDelegate.mm.

260 :(UIApplication*)application
261 didReceiveRemoteNotification:(NSDictionary*)userInfo
262 fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
263 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
264 if (!delegate) {
265 continue;
266 }
267 if ([delegate respondsToSelector:_cmd]) {
268 if ([delegate application:application
269 didReceiveRemoteNotification:userInfo
270 fetchCompletionHandler:completionHandler]) {
271 return;
272 }
273 }
274 }
275 }

## ◆ application:didRegisterForRemoteNotificationsWithDeviceToken:

- (void) application: |  | (UIApplication*) | application
didRegisterForRemoteNotificationsWithDeviceToken: |  | (NSData*) | deviceToken

Calls all plugins registered for `UIApplicationDelegate` callbacks.

Definition at line 66 of file FlutterPluginAppLifeCycleDelegate.mm.

235 :(UIApplication*)application
236 didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
237 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
238 if (!delegate) {
239 continue;
240 }
241 if ([delegate respondsToSelector:_cmd]) {
242 [delegate application:application
243 didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
244 }
245 }
246 }

## ◆ application:didRegisterUserNotificationSettings:

- (void) application: |  | (UIApplication *) | application
didRegisterUserNotificationSettings: |  | ("See - deprecation") | [UIApplicationDelegate application:didRegisterUserNotificationSettings:]
|  | (ios(8.0, 10.0)) | API_DEPRECATED

Called if this plugin has been registered for `UIApplicationDelegate` callbacks.

## ◆ application:handleEventsForBackgroundURLSession:completionHandler:

- (BOOL) application: |  | (UIApplication *) | application
handleEventsForBackgroundURLSession: |  | (nonnull NSString *) | identifier
completionHandler: |  | (nonnull void(^)(void)) | completionHandler

Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles the request.

Returns
  `YES` if any plugin handles the request.

## ◆ application:handleOpenURL:

- (BOOL) application: |  | (UIApplication*) | application
handleOpenURL: |  | (NSURL*) | url

Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles the request.

Returns
  `YES` if any plugin handles the request.

Definition at line 66 of file FlutterPluginAppLifeCycleDelegate.mm.

333 :(UIApplication*)application handleOpenURL:(NSURL*)url {
334 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
335 if (!delegate) {
336 continue;
337 }
338 if ([delegate respondsToSelector:_cmd]) {
339 if ([delegate application:application handleOpenURL:url]) {
340 return YES;
341 }
342 }
343 }
344 return NO;
345 }

## ◆ application:openURL:options:

- (BOOL) application: |  | (UIApplication*) | application
openURL: |  | (NSURL*) | url
options: |  | (NSDictionary<UIApplicationOpenURLOptionsKey, id>*) | options

Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles the request.

Returns
  `YES` if any plugin handles the request.

Definition at line 66 of file FlutterPluginAppLifeCycleDelegate.mm.

317 :(UIApplication*)application
318 openURL:(NSURL*)url
319 options:(NSDictionary<UIApplicationOpenURLOptionsKey, id>*)options {
320 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
321 if (!delegate) {
322 continue;
323 }
324 if ([delegate respondsToSelector:_cmd]) {
325 if ([delegate application:application openURL:url options:options]) {
326 return YES;
327 }
328 }
329 }
330 return NO;
331 }

## ◆ application:openURL:sourceApplication:annotation:

- (BOOL) application: |  | (UIApplication*) | application
openURL: |  | (NSURL*) | url
sourceApplication: |  | (NSString*) | sourceApplication
annotation: |  | (id) | annotation

Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles the request.

Returns
  `YES` if any plugin handles the request.

Definition at line 66 of file FlutterPluginAppLifeCycleDelegate.mm.

347 :(UIApplication*)application
348 openURL:(NSURL*)url
349 sourceApplication:(NSString*)sourceApplication
350 annotation:(id)annotation {
351 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
352 if (!delegate) {
353 continue;
354 }
355 if ([delegate respondsToSelector:_cmd]) {
356 if ([delegate application:application
357 openURL:url
358 sourceApplication:sourceApplication
359 annotation:annotation]) {
360 return YES;
361 }
362 }
363 }
364 return NO;
365 }

## ◆ application:performActionForShortcutItem:completionHandler:

- (void) application: |  | (UIApplication *) | application
performActionForShortcutItem: |  | (UIApplicationShortcutItem *) | shortcutItem
completionHandler: |  | (ios(9.0)) | API_AVAILABLE

Calls all plugins registered for `UIApplicationDelegate` callbacks.

## ◆ application:performFetchWithCompletionHandler:

- (BOOL) application: |  | (UIApplication*) | application
performFetchWithCompletionHandler: |  | (void(^)(UIBackgroundFetchResult result)) | completionHandler

Calls all plugins registered for `UIApplicationDelegate` callbacks in order of registration until some plugin handles the request.

Returns
  `YES` if any plugin handles the request.

Definition at line 66 of file FlutterPluginAppLifeCycleDelegate.mm.

402 :(UIApplication*)application
403 performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
404 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
405 if (!delegate) {
406 continue;
407 }
408 if ([delegate respondsToSelector:_cmd]) {
409 if ([delegate application:application performFetchWithCompletionHandler:completionHandler]) {
410 return YES;
411 }
412 }
413 }
414 return NO;
415 }

## ◆ application:willFinishLaunchingWithOptions:

- (BOOL) application: |  | (UIApplication*) | application
willFinishLaunchingWithOptions: |  | (NSDictionary*) | launchOptions

Calls all plugins registered for `UIApplicationDelegate` callbacks.

Returns
  `NO` if any plugin vetos application launch.

Definition at line 66 of file FlutterPluginAppLifeCycleDelegate.mm.

113 :(UIApplication*)application
114 willFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
115 flutter::DartCallbackCache::LoadCacheFromDisk();
116 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in [_delegates allObjects]) {
117 if (!delegate) {
118 continue;
119 }
120 if ([delegate respondsToSelector:_cmd]) {
121 if (![delegate application:application willFinishLaunchingWithOptions:launchOptions]) {
122 return NO;
123 }
124 }
125 }
126 return YES;
127 }

The documentation for this class was generated from the following files:

- shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h
- shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm