Flutter iOS Embedder
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 71 of file FlutterPluginAppLifeCycleDelegate.mm.

114  :(NSObject<FlutterApplicationLifeCycleDelegate>*)delegate {
115  [_delegates addPointer:(__bridge void*)delegate];
116  if (IsPowerOfTwo([_delegates count])) {
117  [_delegates compact];
118  }
119 }
NSPointerArray * _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 534 of file FlutterPluginAppLifeCycleDelegate.mm.

661  :(UIApplication*)application
662  continueUserActivity:(NSUserActivity*)userActivity
663  restorationHandler:(void (^)(NSArray*))restorationHandler {
664  return [self application:application
665  continueUserActivity:userActivity
666  restorationHandler:restorationHandler
667  isFallbackForScene:NO];
668 }

◆ application:didFailToRegisterForRemoteNotificationsWithError:

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

Calls all plugins registered for UIApplicationDelegate callbacks.

Definition at line 201 of file FlutterPluginAppLifeCycleDelegate.mm.

421  :(UIApplication*)application
422  didFailToRegisterForRemoteNotificationsWithError:(NSError*)error {
423  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
424  if (!delegate) {
425  continue;
426  }
427  if ([delegate respondsToSelector:_cmd]) {
428  [delegate application:application didFailToRegisterForRemoteNotificationsWithError:error];
429  }
430  }
431 }

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

146  :(UIApplication*)application
147  didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
148  if (_delegates.count > 0) {
149  self.didForwardApplicationDidLaunch = YES;
150  }
151  return [self application:application
152  didFinishLaunchingWithOptions:launchOptions
153  isFallbackForScene:NO];
154 }

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

433  :(UIApplication*)application
434  didReceiveRemoteNotification:(NSDictionary*)userInfo
435  fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
436  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
437  if (!delegate) {
438  continue;
439  }
440  if ([delegate respondsToSelector:_cmd]) {
441  if ([delegate application:application
442  didReceiveRemoteNotification:userInfo
443  fetchCompletionHandler:completionHandler]) {
444  return;
445  }
446  }
447  }
448 }

◆ application:didRegisterForRemoteNotificationsWithDeviceToken:

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

Calls all plugins registered for UIApplicationDelegate callbacks.

Definition at line 201 of file FlutterPluginAppLifeCycleDelegate.mm.

408  :(UIApplication*)application
409  didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
410  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
411  if (!delegate) {
412  continue;
413  }
414  if ([delegate respondsToSelector:_cmd]) {
415  [delegate application:application
416  didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
417  }
418  }
419 }

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

553  :(UIApplication*)application handleOpenURL:(NSURL*)url {
554  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
555  if (!delegate) {
556  continue;
557  }
558  if ([delegate respondsToSelector:_cmd]) {
559  if ([delegate application:application handleOpenURL:url]) {
560  return YES;
561  }
562  }
563  }
564  return NO;
565 }

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

490  :(UIApplication*)application
491  openURL:(NSURL*)url
492  options:(NSDictionary<UIApplicationOpenURLOptionsKey, id>*)options {
493  return [self application:application openURL:url options:options isFallbackForScene:NO];
494 }

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

567  :(UIApplication*)application
568  openURL:(NSURL*)url
569  sourceApplication:(NSString*)sourceApplication
570  annotation:(id)annotation {
571  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
572  if (!delegate) {
573  continue;
574  }
575  if ([delegate respondsToSelector:_cmd]) {
576  if ([delegate application:application
577  openURL:url
578  sourceApplication:sourceApplication
579  annotation:annotation]) {
580  return YES;
581  }
582  }
583  }
584  return NO;
585 }

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

646  :(UIApplication*)application
647  performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
648  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
649  if (!delegate) {
650  continue;
651  }
652  if ([delegate respondsToSelector:_cmd]) {
653  if ([delegate application:application performFetchWithCompletionHandler:completionHandler]) {
654  return YES;
655  }
656  }
657  }
658  return NO;
659 }

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

220  :(UIApplication*)application
221  willFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
222  if (_delegates.count > 0) {
223  self.didForwardApplicationWillLaunch = YES;
224  }
225  flutter::DartCallbackCache::LoadCacheFromDisk();
226  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in [_delegates allObjects]) {
227  if (!delegate) {
228  continue;
229  }
230  if ([delegate respondsToSelector:_cmd]) {
231  if (![delegate application:application willFinishLaunchingWithOptions:launchOptions]) {
232  return NO;
233  }
234  }
235  }
236  return YES;
237 }

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