Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlutterAppDelegate should forward delegate methods to plugins that register for them #9682

Closed
collinjackson opened this Issue Apr 28, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@collinjackson
Copy link
Contributor

collinjackson commented Apr 28, 2017

I think @mravn-google was looking at this but I couldn't find an issue for it.

If FlutterAppDelegate provided a way for plugins to install handlers for common UIApplicationDelegate methods, this would reduce the amount of boilerplate the devs would have to add to their AppDelegate.m for plugins like push messaging, analytics, etc. in the common case.

/cc @mit-mit @jakobr-google @goderbauer

@mravn-google mravn-google self-assigned this Apr 28, 2017

@mravn-google

This comment has been minimized.

Copy link
Contributor

mravn-google commented Apr 28, 2017

I am. Thanks for creating the issue.

@mravn-google

This comment has been minimized.

Copy link
Contributor

mravn-google commented May 1, 2017

Below are the (non-deprecated) UIApplicationDelegate methods. Many of them may introduce cross-plugin interference, if we (or plugin implementors) are not careful.

Examples: some of them take a completion handler argument, and can logically only be delegated to one plugin. Others might be sensitive to plugin ordering, like those that take NSCoder arguments for storing/restoring state.

Another issue is that implementing some of these methods require a corresponding configuration entry in Info.plist, lest Xcode will say e.g.

You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:],
but you still need to add "remote-notification" to the list of your supported
UIBackgroundModes in your Info.plist.

Do we want to add such an entry to our templates?

application:willFinishLaunchingWithOptions:
application:didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationWillResignActive:
applicationDidEnterBackground:
applicationWillEnterForeground:
applicationWillTerminate:
applicationProtectedDataWillBecomeUnavailable:
applicationProtectedDataDidBecomeAvailable:
applicationDidReceiveMemoryWarning:
applicationSignificantTimeChange:
application:shouldSaveApplicationState:
application:shouldRestoreApplicationState:
application:viewControllerWithRestorationIdentifierPath:coder:
application:willEncodeRestorableStateWithCoder:
application:didDecodeRestorableStateWithCoder:
application:performFetchWithCompletionHandler:
application:handleEventsForBackgroundURLSession:completionHandler:
application:didRegisterUserNotificationSettings:
application:didRegisterForRemoteNotificationsWithDeviceToken:
application:didFailToRegisterForRemoteNotificationsWithError:
application:didReceiveRemoteNotification:fetchCompletionHandler:
application:willContinueUserActivityWithType:
application:continueUserActivity:restorationHandler:
application:didUpdateUserActivity:
application:didFailToContinueUserActivityWithType:error:
application:performActionForShortcutItem:completionHandler:
application:handleWatchKitExtensionRequest:reply:
applicationShouldRequestHealthAuthorization:
application:openURL:options:
application:shouldAllowExtensionPointIdentifier:
application:supportedInterfaceOrientationsForWindow:
application:willChangeStatusBarOrientation:duration:
application:didChangeStatusBarOrientation:
application:willChangeStatusBarFrame:
application:didChangeStatusBarFrame:
application:userDidAcceptCloudKitShareWithMetadata:

@collinjackson collinjackson added this to the 3: Make conferences happy milestone May 2, 2017

@mravn-google

This comment has been minimized.

Copy link
Contributor

mravn-google commented May 9, 2017

Fixed by #9818 and friends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.