J'utilise APNS Sharp bibliothèque pour ma notification push Apple. J'ai délogé de Here. J'utiliser un programme de test échantillon fourni par la bibliothèque pointue APNS sans aucune modification.
il n'envoie simplement aucune notification jusqu'à ce que je mette le point de rupture à cette ligne de code. si je mets le point de rupture. Je travaille juste bien. Est ce comportement attendu ou je fais quelque chose de mal. et aussi je ne reçois aucune exception. Merci pour toute aide. est ici le codeApple Push notification avec APNS forte
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();
}
J'espère que ma question est claire ...
Mise à jour: je suis coincé here.please quelqu'un peut me aider.
juste vérifier: Vous avez votre cert, non? est votre mot de passe 'mot de passe'? Je me demandais simplement si c'était quelque chose qui restait de l'exemple. – ACBurk
Merci ACBurk. oui j'ai tout. ça marche bien si je mets un point de rupture. – Nnp