Skip to content

Commit

Permalink
Updates readme for iOS Setup (#1776)
Browse files Browse the repository at this point in the history
Adds the import statement required for AppDelegate.swift and AppDelegate.m to use FlutterLocalNotificationsPlugin's setPluginRegistrantCallback function.
  • Loading branch information
som-R91 committed Nov 13, 2022
1 parent af5fbe2 commit 60a47a6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions flutter_local_notifications/README.md
Expand Up @@ -360,6 +360,10 @@ Adjust `AppDelegate.m` and set the plugin registrant callback:

If you're using Objective-C, add this function anywhere in AppDelegate.m:
``` objc
// This is required for calling FlutterLocalNotificationsPlugin.setPluginRegistrantCallback method.
#import <FlutterLocalNotificationsPlugin.h>
...
...
void registerPlugins(NSObject<FlutterPluginRegistry>* registry) {
[GeneratedPluginRegistrant registerWithRegistry:registry];
}
Expand All @@ -380,6 +384,12 @@ For Swift, open the `AppDelegate.swift` and update the `didFinishLaunchingWithOp
where the commented code indicates the code to add in and why

```swift
import UIKit
import Flutter
// This is required for calling FlutterLocalNotificationsPlugin.setPluginRegistrantCallback method.
import flutter_local_notifications

@UIApplicationMain
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
Expand Down

0 comments on commit 60a47a6

Please sign in to comment.