【问题标题】:Is it mandatory to use FCM in iOS Client app for receiving remote notification if the server side uses FCM for sending notifications如果服务器端使用 FCM 发送通知,是否必须在 iOS 客户端应用程序中使用 FCM 来接收远程通知
【发布时间】:2019-01-18 17:40:59
【问题描述】:

我想在我的 iOS 应用程序中实现远程通知。服务器端已使用 Firebase Cloud Messaging 发送通知。是否必须在 iOS 客户端应用中使用 Firebase Cloud Messaging 来接收远程通知?

【问题讨论】:

    标签: ios push-notification firebase-cloud-messaging


    【解决方案1】:

    是的,您必须在客户端使用 FCM。用于向特定用户发送通知,需要在服务器端存储用户 FCM 令牌。

        guard FIRInstanceID.instanceID().token() == nil else {            
                    if let token = FIRInstanceID.instanceID().token() {
                        // send token to server
                    }
    }
    

    【讨论】:

      猜你喜欢
      • 2017-04-07
      • 2022-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-05
      • 2017-11-16
      • 2016-09-27
      • 2017-08-11
      相关资源
      最近更新 更多