我正在尝试按照Azure's guide设置iOS推送通知。但是说到步骤6时,


  在AppDelegate.cs中,更新FinishedLaunching()以匹配
  以下:

public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
{
   if (UIDevice.CurrentDevice.CheckSystemVersion (8, 0)) {
      var pushSettings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, new NSSet ());

      UIApplication.SharedApplication.RegisterUserNotificationSettings(pushSettings);
      UIApplication.SharedApplication.RegisterForRemoteNotifications ();
   } else {
      UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound;
      UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes);
   }

   return true;
}



我收到此错误Type 'AppDelegate' already defines a member called 'FinishedLaunching' with the same parameter types.

我怎样才能解决这个问题?

最佳答案

抱歉,我没有看到Xamarin在创建项目时创建了它自己的FinishedLaunching

08-03 13:11