AppDelegate 已经定义了 FinishedLaunching
AppDelegate already defines FinishedLaunching
我正在尝试按照 Azure's guide 设置 iOS 推送通知。但是当谈到第 6 步时,那就是
In AppDelegate.cs
, update FinishedLaunching() to match the
following:
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
我正在尝试按照 Azure's guide 设置 iOS 推送通知。但是当谈到第 6 步时,那就是
In
AppDelegate.cs
, update FinishedLaunching() to match the following: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