【发布时间】:2021-11-02 05:29:35
【问题描述】:
有没有办法通过代码禁用应用程序的警报设置?我已经使用下面的代码启用了这些设置,但是我找不到任何方法可以在用户操作时再次禁用这些设置。
var pushSettings = UIUserNotificationSettings.GetSettingsForTypes(
UIUserNotificationType.Alert |
UIUserNotificationType.Badge |
UIUserNotificationType.Sound,
new NSSet());
UIApplication.SharedApplication.RegisterUserNotificationSettings(pushSettings);
UIApplication.SharedApplication.RegisterForRemoteNotifications();
有以下方法,但它不会在应用程序设置中禁用通知。
UIApplication.SharedApplication.UnregisterForRemoteNotifications
【问题讨论】:
标签: xamarin xamarin.forms push-notification uiapplication