开发者

Android (c2dm) push notification error

i am creating开发者_如何学C a push notification server for android by using C2DM-Sharp library. i have created a sample code to test push notification, but while iam closing the connection the code is giving an error "One or more errors occurred." "A task was canceled." below is my code

C2dmService service;

        //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


I have already given the answer of all think relate to C2DM service in android please show the given link

C2DM permission.C2D_MESSAGE gives Installation error

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜