Firebase通知-打开应用程序时无通知(Swift)

时间:2018-06-22 15:42:02

标签: swift firebase push-notification firebase-cloud-messaging firebase-notifications

打开应用程序后,为什么通知不起作用?

UNUserNotificationCenter.current().delegate = self
let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
                options: authOptions,
                completionHandler: {_, _ in })
Messaging.messaging().delegate = self
application.registerForRemoteNotifications()
FirebaseApp.configure()

0 个答案:

没有答案