相关疑难解决方法(0)

如何使用FCM向特定用户发送通知?

我为FCM准备了接收器,可以向所有设备发送通知.

带有此链接的gcm-http.googleapis.com/gcm/send可以发送给已注册的目标用户并将其发布到目标设备,如下面的json:

 {
     "notification": {
                "title": "sample Title",
                "text": "sample text"   },   
        "to" : "[registration id]"
         }
Run Code Online (Sandbox Code Playgroud)

但是,我需要通过电子邮件或姓名等向我选择的目标用户发送通知.例如:

{
     "notification": {
                "title": "sample Title",
                "text": "sample text"   },   
        "to" : "[email or name or sex ...]"
         }
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?我是否需要创建Web服务器或其他东西?

notifications android firebase google-cloud-messaging firebase-cloud-messaging

23
推荐指数
1
解决办法
3万
查看次数