Android(c2dm)推送通知错误

本文关键字:通知 错误 c2dm Android | 更新日期: 2023-09-27 17:58:29

我正在使用C2DM Sharp库为android创建推送通知服务器。我已经创建了一个测试推送通知的示例代码,但当我关闭连接时,代码给出了一个错误"发生了一个或多个错误"。"一个任务被取消。"下面是我的代码

C2dm服务;

        //Service emailid 
        var senderID = "myservice@gmail.com"; 
        var password = "myservice Password";
        //The application that is registering to receive messages
        var applicationID = "appID";
        service = new C2dmService(senderID, password, applicationID);
        service.Start();
        NameValueCollection extras;
        //for (int i = 0; i < 3; i++)
        //{
            extras = new NameValueCollection();
            //
            string registrationId = textBox4.Text;
            //An ID issued by the C2DM servers to the Android application that allows it to receive messages
            string collapseKey = "CKEY";
            string key = "count";
            string value = "5";
            extras.Add(key, value);
           //Queue up the message to be sent
            service.QueueMessage(registrationId, extras, collapseKey);
        //}
            service.Stop();------- its giving error here at the time of stoping the service

Android(c2dm)推送通知错误

我已经给出了所有认为与android中的C2DM服务相关的答案,请显示给定的链接

C2DM权限。C2D_MESSAGE给出安装错误

c2dm:如何在设备中接收消息?(使用PHP)