How to send device to device messages using Firebase Cloud Messaging?

后端 未结 13 1936
Happy的楠姐
Happy的楠姐 2020-11-22 01:47

After searching the docs I could not find any info on how to send device to device messages using FCM without the use of an external server.

For example, if I was cr

13条回答
  •  無奈伤痛
    2020-11-22 02:12

    UPDATE: It is now possible to use firebase cloud functions as the server for handling push notifications. Check out their documentation here

    ============

    According to the docs you must implement a server for handling push notifications in device to device communication.

    Before you can write client apps that use Firebase Cloud Messaging, you must have an app server that meets the following criteria:

    ...

    You'll need to decide which FCM connection server protocol(s) you want to use to enable your app server to interact with FCM connection servers. Note that if you want to use upstream messaging from your client applications, you must use XMPP. For a more detailed discussion of this, see Choosing an FCM Connection Server Protocol.

    If you only need to send basic notifications to your users from the server. You can use their serverless solution, Firebase Notifications.

    See a comparison here between FCM and Firebase Notifications: https://firebase.google.com/support/faq/#messaging-difference

提交回复
热议问题