title: Notification permission after user login in Xamarin Forms?
body: <p>I wanted to move the notification permission after the user logs in but it always shows up at the startup of the app for iOS.</p>
  <p>AppDelegate.cs</p>
  <pre><code>public override bool FinishedLaunching(UIApplication app, NSDictionary options)
  {
      // other code here
      ......
  
     InitializeAppCenter();
  }
  
  void InitializeAppCenter()
  {
       AppCenter.Start(myAppSecret, typeof(Push));
      // app center initialization
     ......
  
     
        this.pushNotificationServiceDelegate = new PushNotificationDelegate();
        UNUserNotificationCenter.Current.Delegate = this.pushNotificationServiceDelegate;
      
   }
  </code></pre>
  <p>PushNotificationDelegate.cs</p>
  <pre><code>[assembly: Dependency(typeof(PushNotificationDelegate))]
  namespace Test.iOS.DependencyServices
  {
      public class PushNotificationDelegate : UNUserNotificationCenterDelegate, INotificationPermission
      {
  
       public bool didReceiveNotificationInForeground { get; set; }
  
      public void Request()
      {
          if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
          {
              // Ask the user for permission to get notifications on iOS 10.0+
              UNUserNotificationCenter.Current.RequestAuthorization(
                     UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound,
                     //UNAuthorizationOptions.Alert | UNAuthorizationOptions.Sound,
                     (approved, error) =&gt; {
  
                         if (approved)
                             InvokeOnMainThread(UIApplication.SharedApplication.RegisterForRemoteNotifications);
                     });
          }
          else if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
          {
              // Ask the user for permission to get notifications on iOS 8.0+
              var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes(
                      UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound,
                      new NSSet());
  
              UIApplication.SharedApplication.RegisterUserNotificationSettings(notificationSettings);
              UIApplication.SharedApplication.RegisterForRemoteNotifications();
          }
      }
  
     public override void WillPresentNotification(UNUserNotificationCenter center, UNNotification notification, Action&lt;UNNotificationPresentationOptions&gt; completionHandler)
     {
        //.....
     }
  
  
     }
  }
  </code></pre>
  <p>Supposedly it should register only the delegate and shows a permission authorization for notification ONLY when Request method is called via dependency service.</p>
  <p>After the user login I use the dependency service <code>INotificationPermission</code> request method . but nothing shows up because the notification permission authorization was asked from the startup.</p>
  <p>Right now I am using AppCenter push for notifications.
  How to move notification permission from startup and call only when necessary?</p>