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

106 :(NSObject<FlutterApplicationLifeCycleDelegate>*)delegate {
107 [_delegates addPointer:(__bridge void*)delegate];
108 if (IsPowerOfTwo([_delegates count])) {
109 [_delegates compact];
110 }
111 }

References _delegates.

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

432 :(UIApplication*)application
433 continueUserActivity:(NSUserActivity*)userActivity
434 restorationHandler:(void (^)(NSArray*))restorationHandler {
435 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
436 if (!delegate) {
437 continue;
438 }
439 if ([delegate respondsToSelector:_cmd]) {
440 if ([delegate application:application
441 continueUserActivity:userActivity
442 restorationHandler:restorationHandler]) {
443 return YES;
444 }
445 }
446 }
447 return NO;
448 }

References _delegates.

## ◆ application:didFailToRegisterForRemoteNotificationsWithError:

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

Calls all plugins registered for `UIApplicationDelegate` callbacks.

Definition at line 263 of file FlutterPluginAppLifeCycleDelegate.mm.

263 :(UIApplication*)application
264 didFailToRegisterForRemoteNotificationsWithError:(NSError*)error {
265 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
266 if (!delegate) {
267 continue;
268 }
269 if ([delegate respondsToSelector:_cmd]) {
270 [delegate application:application didFailToRegisterForRemoteNotificationsWithError:error];
271 }
272 }
273 }

References _delegates.

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

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

References _delegates.

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

275 :(UIApplication*)application
276 didReceiveRemoteNotification:(NSDictionary*)userInfo
277 fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
278 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
279 if (!delegate) {
280 continue;
281 }
282 if ([delegate respondsToSelector:_cmd]) {
283 if ([delegate application:application
284 didReceiveRemoteNotification:userInfo
285 fetchCompletionHandler:completionHandler]) {
286 return;
287 }
288 }
289 }
290 }

References _delegates.

## ◆ application:didRegisterForRemoteNotificationsWithDeviceToken:

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

Calls all plugins registered for `UIApplicationDelegate` callbacks.

Definition at line 250 of file FlutterPluginAppLifeCycleDelegate.mm.

250 :(UIApplication*)application
251 didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
252 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
253 if (!delegate) {
254 continue;
255 }
256 if ([delegate respondsToSelector:_cmd]) {
257 [delegate application:application
258 didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
259 }
260 }
261 }

References _delegates.

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

348 :(UIApplication*)application handleOpenURL:(NSURL*)url {
349 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
350 if (!delegate) {
351 continue;
352 }
353 if ([delegate respondsToSelector:_cmd]) {
354 if ([delegate application:application handleOpenURL:url]) {
355 return YES;
356 }
357 }
358 }
359 return NO;
360 }

References _delegates.

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

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

References _delegates.

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

362 :(UIApplication*)application
363 openURL:(NSURL*)url
364 sourceApplication:(NSString*)sourceApplication
365 annotation:(id)annotation {
366 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
367 if (!delegate) {
368 continue;
369 }
370 if ([delegate respondsToSelector:_cmd]) {
371 if ([delegate application:application
372 openURL:url
373 sourceApplication:sourceApplication
374 annotation:annotation]) {
375 return YES;
376 }
377 }
378 }
379 return NO;
380 }

References _delegates.

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

417 :(UIApplication*)application
418 performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
419 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
420 if (!delegate) {
421 continue;
422 }
423 if ([delegate respondsToSelector:_cmd]) {
424 if ([delegate application:application performFetchWithCompletionHandler:completionHandler]) {
425 return YES;
426 }
427 }
428 }
429 return NO;
430 }

References _delegates.

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

128 :(UIApplication*)application
129 willFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
130 flutter::DartCallbackCache::LoadCacheFromDisk();
131 for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in [_delegates allObjects]) {
132 if (!delegate) {
133 continue;
134 }
135 if ([delegate respondsToSelector:_cmd]) {
136 if (![delegate application:application willFinishLaunchingWithOptions:launchOptions]) {
137 return NO;
138 }
139 }
140 }
141 return YES;
142 }

References _delegates.

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

_delegates
NSPointerArray * _delegates
Definition: FlutterPluginAppLifeCycleDelegate.mm:37