Skip to content

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

Closed

Description

@collinjackson

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

Activity

  1. self-assigned this
    on Apr 28, 2017
  2. mravn-google commented on Apr 28, 2017

    @mravn-google
    Contributor

    I am. Thanks for creating the issue.

  3. mravn-google commented on May 1, 2017

    @mravn-google
    Contributor

    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:
    
  4. added this to the milestone on May 2, 2017
  5. mravn-google commented on May 9, 2017

    @mravn-google
    Contributor

    Fixed by #9818 and friends.

  6. github-actions commented on Sep 5, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  7. locked as resolved and limited conversation to collaborators on Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: API breakBackwards-incompatible API changes

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions