Flutter Engine
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: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 referenced weakly.

Definition at line 99 of file FlutterPluginAppLifeCycleDelegate.mm.

References _delegates.

99  :(NSObject<FlutterApplicationLifeCycleDelegate>*)delegate {
100  [_delegates addPointer:(__bridge void*)delegate];
101  if (isPowerOfTwo([_delegates count])) {
102  [_delegates compact];
103  }
104 }
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 413 of file FlutterPluginAppLifeCycleDelegate.mm.

References _delegates.

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

◆ application:didFinishLaunchingWithOptions:()

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

Calls all plugins registered for UIApplicationDelegate callbacks.

Returns
NO if any plugin vetoes application launch.

Definition at line 106 of file FlutterPluginAppLifeCycleDelegate.mm.

References _delegates.

106  :(UIApplication*)application
107  didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
108  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in [_delegates allObjects]) {
109  if (!delegate) {
110  continue;
111  }
112  if ([delegate respondsToSelector:_cmd]) {
113  if (![delegate application:application didFinishLaunchingWithOptions:launchOptions]) {
114  return NO;
115  }
116  }
117  }
118  return YES;
119 }
NSPointerArray * _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 251 of file FlutterPluginAppLifeCycleDelegate.mm.

References _delegates.

251  :(UIApplication*)application
252  didReceiveRemoteNotification:(NSDictionary*)userInfo
253  fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler {
254  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
255  if (!delegate) {
256  continue;
257  }
258  if ([delegate respondsToSelector:_cmd]) {
259  if ([delegate application:application
260  didReceiveRemoteNotification:userInfo
261  fetchCompletionHandler:completionHandler]) {
262  return;
263  }
264  }
265  }
266 }
NSPointerArray * _delegates

◆ application:didRegisterForRemoteNotificationsWithDeviceToken:()

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

Calls all plugins registered for UIApplicationDelegate callbacks.

Definition at line 238 of file FlutterPluginAppLifeCycleDelegate.mm.

References _delegates.

238  :(UIApplication*)application
239  didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
240  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
241  if (!delegate) {
242  continue;
243  }
244  if ([delegate respondsToSelector:_cmd]) {
245  [delegate application:application
246  didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
247  }
248  }
249 }
NSPointerArray * _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 329 of file FlutterPluginAppLifeCycleDelegate.mm.

References _delegates.

329  :(UIApplication*)application handleOpenURL:(NSURL*)url {
330  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
331  if (!delegate) {
332  continue;
333  }
334  if ([delegate respondsToSelector:_cmd]) {
335  if ([delegate application:application handleOpenURL:url]) {
336  return YES;
337  }
338  }
339  }
340  return NO;
341 }
NSPointerArray * _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 313 of file FlutterPluginAppLifeCycleDelegate.mm.

References _delegates.

313  :(UIApplication*)application
314  openURL:(NSURL*)url
315  options:(NSDictionary<UIApplicationOpenURLOptionsKey, id>*)options {
316  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
317  if (!delegate) {
318  continue;
319  }
320  if ([delegate respondsToSelector:_cmd]) {
321  if ([delegate application:application openURL:url options:options]) {
322  return YES;
323  }
324  }
325  }
326  return NO;
327 }
NSPointerArray * _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 343 of file FlutterPluginAppLifeCycleDelegate.mm.

References _delegates.

343  :(UIApplication*)application
344  openURL:(NSURL*)url
345  sourceApplication:(NSString*)sourceApplication
346  annotation:(id)annotation {
347  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
348  if (!delegate) {
349  continue;
350  }
351  if ([delegate respondsToSelector:_cmd]) {
352  if ([delegate application:application
353  openURL:url
354  sourceApplication:sourceApplication
355  annotation:annotation]) {
356  return YES;
357  }
358  }
359  }
360  return NO;
361 }
NSPointerArray * _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 398 of file FlutterPluginAppLifeCycleDelegate.mm.

References _delegates.

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

◆ application:willFinishLaunchingWithOptions:()

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

Calls all plugins registered for UIApplicationDelegate callbacks.

Returns
NO if any plugin vetoes application launch.

Definition at line 121 of file FlutterPluginAppLifeCycleDelegate.mm.

References _debugBackgroundTask, _delegates, and flutter::DartCallbackCache::LoadCacheFromDisk().

121  :(UIApplication*)application
122  willFinishLaunchingWithOptions:(NSDictionary*)launchOptions {
124  for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in [_delegates allObjects]) {
125  if (!delegate) {
126  continue;
127  }
128  if ([delegate respondsToSelector:_cmd]) {
129  if (![delegate application:application willFinishLaunchingWithOptions:launchOptions]) {
130  return NO;
131  }
132  }
133  }
134  return YES;
135 }
NSPointerArray * _delegates

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