snnagar / apns-sharp

Automatically exported from code.google.com/p/apns-sharp
0 stars 0 forks source link

hello, i have question #51

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
hi,

i have question when i download this library
but when i test in my website (i using C#)

using service.QueueNotification(alertNotification)

no error.... and it's response for me 'Notification Queued!'

//*** here is my code ***//
NotificationPayload simple = new NotificationPayload();

        // get Push Notification instance
        //NotificationService pushManager = NotificationService.get

        bool sandbox = true;
        String testDeviceToken = "c1cd60286a4cabf3ce50fca2437c6ae648fb3b6dae6adf01c58be0c654e3b4b4";
        String p12File = "apsnkey.p12";
        String p12FilePassword = "abcdefg";

        int count = 3;
        int sleepBetweenNotifications = 100;

        String p12FileName = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, p12File);

        NotificationService service = new NotificationService(sandbox, p12FileName, p12FilePassword, 1);

        Notification alertNotification = new Notification(testDeviceToken);

        alertNotification.Payload.Alert.Body = String.Format("Testing ...");
        alertNotification.Payload.Sound = "default";
        alertNotification.Payload.Badge = 1;

        service.SendRetries = 5;
        service.ReconnectDelay = 5000; //5 sec

        service.Error += new NotificationService.OnError(service_Error);
        service.NotificationTooLong += new NotificationService.OnNotificationTooLong(service_NotificationTooLong);

        service.BadDeviceToken += new NotificationService.OnBadDeviceToken(service_BadDeviceToken);
        service.NotificationFailed += new NotificationService.OnNotificationFailed(service_NotificationFailed);
        service.NotificationSuccess += new NotificationService.OnNotificationSuccess(service_NotificationSuccess);
        service.Connecting += new NotificationService.OnConnecting(service_Connecting);
        service.Connected += new NotificationService.OnConnected(service_Connected);
        service.Disconnected += new NotificationService.OnDisconnected(service_Disconnected);

        if (service.QueueNotification(alertNotification))
            Response.Write("Notification Queued!");
 else
            Response.Write("Notification Failed to be Queued!");

service.Close();
        service.Dispose();
// *** //

but my deveice no get any notification message...

how should i do?

thanks,

Eric

Original issue reported on code.google.com by ilyi1...@gmail.com on 22 Apr 2011 at 5:34