how to generate local notification in ios 10 when your app in forground? When your app in forground then it's not work
<p>this following step i do in my app </p>

<p>in my <strong>appdelegate</strong> </p>

<pre><code>#import &lt;UserNotifications/UserNotifications.h&gt;


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.


    UNUserNotificationCenter* center = [UNUserNotificationCenter currentNotificationCenter];
      center.delegate = (id)self;

    [center requestAuthorizationWithOptions:(UNAuthorizationOptionAlert + UNAuthorizationOptionSound)
                          completionHandler:^(BOOL granted, NSError * _Nullable error) {


                              // Enable or disable features based on authorization.
                          }];







    return YES;
}
</code></pre>

<p>and in my <strong>viewcontroller</strong> the code for generate local notification</p>

<pre><code>-(IBAction)btnclicked:(id)sender 
{
    UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init];
    content.title = @"gg";
     content.subtitle = @"ggg";
    content.body = @"hhh";
    content.sound = [UNNotificationSound defaultSound];

    // Deliver the notification in five seconds.
    UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger
                                                  triggerWithTimeInterval:5 repeats:NO];
    UNNotificationRequest* request = [UNNotificationRequest requestWithIdentifier:@"2"
                                                                          content:content trigger:trigger
                                      ];

    // Schedule the notification.
    UNUserNotificationCenter* center = [UNUserNotificationCenter currentNotificationCenter];
    [center addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
        NSLog(@"hii");
    }];





}
</code></pre>

<p>Now When my app in <strong>foreground</strong> Notification not generating.</p>

<p>in ios 9 i use</p>

<pre><code> UILocalNotification* localNotification = [[UILocalNotification alloc] init];
    localNotification.soundName = @"Default";
    localNotification.alertBody = @"my notification;)";
    localNotification.fireDate = [NSDate date];
    localNotification.category = @"Email";
    localNotification.repeatInterval = kCFCalendarUnitDay;
    [[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
</code></pre>

<p>this code work in ios 9 but in ios 10 UILocalNotification is deprecate.</p>

<p>so how to generate local notification in ios 10 when your app in foreground ?</p>