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

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

◆ application:didFailToRegisterForRemoteNotificationsWithError:

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

Calls all plugins registered for UIApplicationDelegate callbacks.

Definition at line 203 of file FlutterPluginAppLifeCycleDelegate.mm.

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

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

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

◆ application:didRegisterForRemoteNotificationsWithDeviceToken:

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

Calls all plugins registered for UIApplicationDelegate callbacks.

Definition at line 203 of file FlutterPluginAppLifeCycleDelegate.mm.

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

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

553  :(UIApplication*)application handleOpenURL:(NSURL*)url {
554  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates.allObjects) {
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 203 of file FlutterPluginAppLifeCycleDelegate.mm.

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

◆ 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 536 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.allObjects) {
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 536 of file FlutterPluginAppLifeCycleDelegate.mm.

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

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

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

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