我正在利用Utilities
类的单个实例来显示弹出窗口并请求Push Notifications
访问,但是我已将AppDelegate
类设为{{1 }}和delegate
,因此在用户在注册过程中授予访问权限时,永远不会调用FirebaseMessaging
函数,因此在该时间不保存令牌。
在收到新的注册令牌的情况下,我需要将UserNotifications
和didReceiveRegistrationToken
用作通知,并保存它。
如何从实用程序类中创建AppDelegate
,delegate
和AppDelegate
?
不允许声明AppDelegate单例。
实用程序类:
UNUserNotificationCenter.current().delegate
AppDelegate类:
Messaging.messaging().delegate