我正在使用FCM从我自己的服务器向iOS设备发送通知。当应用程序处于前台或最小化状态时,我成功地收到了通知。但当我完全关闭应用程序时,即使从后台,我也不会收到任何通知。但是,当我重新打开应用程序时,我得到了所有的通知,我之前发送?我该如何改变这种情况?
在 didFinishLaunchingWithOptions
我在注册通知.在获取通知和安排本地通知。didReceiveRemoteNotification
获取通知和调度本地通知。
添加这行
Messaging.messaging().shouldEstablishDirectChannel = true
之后
FirebaseApp.configure()
Messaging.messaging().delegate = self
Messaging.messaging().shouldEstablishDirectChannel = true