| 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 67 of file FlutterPluginAppLifeCycleDelegate.mm.

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

## ◆ 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 67 of file FlutterPluginAppLifeCycleDelegate.mm.

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

## ◆ application:didFailToRegisterForRemoteNotificationsWithError:

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

Calls all plugins registered for `UIApplicationDelegate` callbacks.

Definition at line 67 of file FlutterPluginAppLifeCycleDelegate.mm.

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

## ◆ 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 67 of file FlutterPluginAppLifeCycleDelegate.mm.

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

## ◆ 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 67 of file FlutterPluginAppLifeCycleDelegate.mm.

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

## ◆ application:didRegisterForRemoteNotificationsWithDeviceToken:

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

Calls all plugins registered for `UIApplicationDelegate` callbacks.

Definition at line 67 of file FlutterPluginAppLifeCycleDelegate.mm.

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

## ◆ 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 67 of file FlutterPluginAppLifeCycleDelegate.mm.

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

## ◆ 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 67 of file FlutterPluginAppLifeCycleDelegate.mm.

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

## ◆ 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 67 of file FlutterPluginAppLifeCycleDelegate.mm.

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

## ◆ 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 67 of file FlutterPluginAppLifeCycleDelegate.mm.

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

## ◆ 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 67 of file FlutterPluginAppLifeCycleDelegate.mm.

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

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