0
iOS 10をターゲットにアップグレードする際に、一部のコードが壊れています。解決策が見つからないため、次のように変換できます。目的C iOS 8で推奨されていないコード
- (void)userRequestsPushNotificationsOn {
UIApplication *application = [UIApplication sharedApplication];
UIUserNotificationType notificationTypes = UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound;
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil];
[application registerUserNotificationSettings:settings];
[application registerForRemoteNotifications];
}
UIUserNotificationType & UIUserNotificationSettingsは推奨されません。
多くの方々、ありがとうございます!
https://stackoverflow.com/questions/39782776/uiusernotificationtype-was-deprecated-in-ios10-swift-3-0を(それは、スウィフトにありますObjective-Cで何を使うべきかを知ることは理解できるはずです) – Larme