为什么将 iOS 升级到 10.3 后,Firebase 通知不再有效?

Why firebase notifications are no longer working after upgrading iOS to10.3?

问题:我在我的项目中使用 firebase,(使用 XCode 7),当我在 iOS 9.x 中测试它们时,推送通知曾经工作,当我升级到 iOS 10.3 并决定再次处理通知,它们不会出现在 iPhone...

我检查过的内容:

1- firebase p12 certificates are valid

2- I have updated the pods for all firebase libs.

3- appdelegate setup is correct

我也尝试过使用 firebase 控制台推送一些消息,它们成功了,但我收到了 none。

在 firebase 文档中,提到了这一点

for devices running iOS 10 and above, you must assign your delegate object to the UNUserNotificationCenter object to receive display notifications, and the FIRMessaging object to receive data messages, before your app finishes launching. For example, in an iOS app, you must assign it in the applicationWillFinishLaunching: or applicationDidFinishLaunching: method.

但问题出在 XCode 7 中,没有 UNUserNotificationCenter,那是否意味着 XCode 7 不再受 firebase 消息传递支持?

编辑

有朋友说:

hm i just tested from the console and it didn't work for me either

EDIT2

当我从 php 文件发送到单个设备时,我在 php 文件中收到此回复

{ "multicast_id": 6096716523074435565, "success": 1, "failure": 0, "canonical_ids": 0, "results": [ { "message_id": "0:1492683303568634%84058575f9fd7ecd" } ] }

顺便说一句,我使用此命令获取令牌

FIRInstanceID.instanceID().token()!

唯一的解决方案是升级到 XCode 8,因为 iOS 10.

中的推送通知发生了变化。