Apple Push Benachrichtigung mit APNS sharp

Ich verwende die APNS Sharp-Bibliothek für meine Apple Push-Benachrichtigung. ich habe von @ downlodieHie .Ich verwende ein von APNS sharp library bereitgestelltes Beispieltestprogramm ohne Änderungen.
it sendet einfach keine Benachrichtigung, bis ich an dieser Codezeile einen Haltepunkt setze. wenn ich Haltepunkt setze. Ich arbeite einfach gut. Ist dieses erwartete Verhalten oder ich mache etwas falsch. und auch ich bekomme keine ausnahme. danke für jede hilfe. hier ist der code

static void Main(string[] args)
{
    bool sandbox = true;
    string testDeviceToken = "Token";
    string p12File = "apn_developer_identity.p12";
    string p12FilePassword = "yourpassword";
    int sleepBetweenNotifications = 15000;
    string p12Filename = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, p12File);
    NotificationService service = new NotificationService(sandbox, p12Filename, p12FilePassword, 1);
    service.SendRetries = 5; 
    service.ReconnectDelay = 5000; //5 seconds
    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);
    Notification alertNotification = new Notification(testDeviceToken);
    alertNotification.Payload.Alert.Body = "Testing {0}...";
    alertNotification.Payload.Sound = "default";
    alertNotification.Payload.Badge = i;
    if (service.QueueNotification(alertNotification))
      Console.WriteLine("Notification Queued!");
    else
      Console.WriteLine("Notification Failed to be Queued!");
    Console.WriteLine("Cleaning Up...");

    service.Close();// if i dont put a break point in here, it simply does not send any notification

    service.Dispose();

}

ich hoffe meine frage ist klar ...
Aktualisieren Ich stecke hier fest. Bitte, jeder kann mir helfen.

Antworten auf die Frage(4)

Ihre Antwort auf die Frage