Tag: firebase cloud messaging

Firebase云消息传递和C#服务器端代码

我在我的Android和iOS应用程序中使用FCM。 客户端代码工作正常,因为从Firebase控制台我可以向两个平台发送通知而不会出现任何问题。 使用我的C#代码,我可以成功向Android设备发送通知,但除非直接来自Firebase通知控制台,否则通知永远不会出现在iPhone上。 我不知道是什么给了。 C#服务器端代码 try { var applicationID = “application_id”; var senderId = “sender_id”; string deviceId = “device_id_of_reciever”; WebRequest tRequest = WebRequest.Create(“https://fcm.googleapis.com/fcm/send”); tRequest.Method = “post”; tRequest.ContentType = “application/json”; var data = new { to = deviceId, notification = new { body = “This is the message”, title = “This is the title”, icon = […]

如何从C#Console应用程序发送通知

我想创建控制台应用程序,用于通过Goolge Firebase Notifications向不同的移动设备发送通知, 我已经看到了使用FCM(Firebase云消息传递)通过C#发送推送到Android的代码 我收到状态码为500的内部服务器错误 try{ string url = @”https://fcm.googleapis.com/fcm/send”; WebRequest tRequest = WebRequest.Create(url); tRequest.Method = “post”; tRequest.ContentType = “application/json”; string postData = “collapse_key=score_update&time_to_live=108&delay_while_idle=1&data.message=” + “This is the message” + “&data.time=” + System.DateTime.Now.ToString() + “&registration_id=” + deviceId + “”; var data = new { to = deviceId, notification = new { body = “This is […]