在iOS 8.x下注册推送通知时:
application.registerForRemoteNotificationTypes(UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound)
我得到以下错误:
registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.
有什么新方法吗?当我在iOS 7.x上运行这个Swift应用程序时,它可以正常工作。
编辑
在iOS 7上。x当我包括我得到的条件代码(SystemVersion条件或#如果__IPHONE_OS_VERSION_MAX_ALLOWED >= 80000)
dyld: Symbol not found: _OBJC_CLASS_$_UIUserNotificationSettings