【发布时间】:2019-10-01 03:39:05
【问题描述】:
我正在尝试在 iOS13 中的 Xcode 11 上设置通知,但我尝试添加链接框架(在图片中)但仍然无法识别模块。有什么建议吗?
import UIKit
import Firebase
import UNUserNotificationCenter
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
FirebaseApp.configure()
let center = UNUserNotificationCenter.current()
// Request permission to display alerts and play sounds.
center.requestAuthorization(options: [.alert, .sound])
{ (granted, error) in
// Enable or disable features based on authorization.
}
return true
}
【问题讨论】:
-
请勿将代码发布为图片。请用文字替换图片(与您的答案相同)。
-
更新@rmaddy
标签: swift xcode11 unusernotificationcenter