我正在将 FCM 与我的 ios 推送通知一起使用。当用户点击推送通知时,如何导航到特定的导航链接。预先感谢您的帮助!
我了解我将处理此功能上的推送通知点击。
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
let userInfo = response.notification.request.content.userInfo
// Print message ID.
if let messageID = userInfo[gcmMessageIDKey] {
print("Message ID userNotificationCenterdidReceive response: \(messageID)")
}
// Print full message.
print(userInfo)
let application = UIApplication.shared
if(application.applicationState == .active){
print("user tapped the notification bar when the app is in foreground")
}
if(application.applicationState == .inactive)
{
print("user tapped the notification bar when the app is in background")
} …Run Code Online (Sandbox Code Playgroud) 上下文:以下是我在 Firebase Firestore 中的集合和文档的屏幕截图。基本上,每个交易文档都有自己的字段和其中的聊天集合。
我需要什么:我的目标是使用特定的 handler_id 查询文档并访问其中的聊天集合。
发生了什么:此查询仅返回交易字段
db.collection("transaction").where("handler_id", "==", 3)
Run Code Online (Sandbox Code Playgroud)