我为FCM准备了接收器,并可以向所有设备发送通知。
通过此链接gcm-http.googleapis.com/gcm/send,可以向已注册的目标用户发送通知并将其发送到目标设备(例如以下JSON代码):
{
"notification": {
"title": "sample Title",
"text": "sample text" },
"to" : "[registration id]"
}
然而,我需要通过电子邮件或者姓名等方式向我选择的目标用户发送通知...
例如:
{
"notification": {
"title": "sample Title",
"text": "sample text" },
"to" : "[email or name or sex ...]"
}
我该怎么做呢? 我需要创建一个Web服务器或其他东西吗?
override fun onNewToken(token: String?) { super.onNewToken(token) } override fun onMessageReceived(msg: RemoteMessage?) { super.onMessageReceived(msg) }
} - John Albert