c# - Android(c2dm)推送通知错误

标签 c# android android-c2dm

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

C2dmService 服务;

        //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 服务相关的答案,请显示给定的链接

C2DM permission.C2D_MESSAGE gives Installation error

c2dm : how to receive the message in the device? (using PHP)

关于c# - Android(c2dm)推送通知错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6265172/

相关文章:

android - 在代码中设置listview项的透明度

c# - 制作每列宽度不同的表格,在 asp.net 的 gridview 中保持表格的整体宽度不变

c# - iTextSharp - 如何获取单词在页面上的位置

java - Android TextView 在一段后切断

java - parseInt 行错误

android - 谷歌云消息 : How to show an icon and group messages

android - "Permission Denial: receiving Intent "的原因

java - Android C2DM 注册失败 INVALID_PARAMETERS

c# - 用于对存储过程进行分组的单独 EDMX

c# - ASP.NET 的 WMI 提供程序