Отправить push-уведомление на iOS с помощью push sharp через C#?
Я хочу отправлять push-уведомления в iOS с помощью толчка резкого библиотека 2.2.2.1
Я не получаю никакой ошибки
но сообщение не отображает устройство apple.
Помощь Оказана.
Что я уже пробовал:
protected void Button1_Click(object sender, EventArgs e) { var push = new PushBroker(); push.OnNotificationSent += NotificationSent; push.OnChannelException += ChannelException; push.OnServiceException += ServiceException; push.OnNotificationFailed += NotificationFailed; push.OnDeviceSubscriptionExpired += DeviceSubscriptionExpired; push.OnDeviceSubscriptionChanged += DeviceSubscriptionChanged; push.OnChannelCreated += ChannelCreated; push.OnChannelDestroyed += ChannelDestroyed; var appleCert = File.ReadAllBytes(Server.MapPath("~/App_Data/Certificates.p12")); push.RegisterAppleService(new ApplePushChannelSettings(appleCert, "Sudesi@123")); push.QueueNotification(new AppleNotification() .ForDeviceToken("d66d339f6d974ed7de4fab006388cce75898c63cebe9fe3f0e2f34ba6a23a1b9") .WithAlert("Hello World!") .WithBadge(7)); push.StopAllServices(); } static void DeviceSubscriptionChanged(object sender, string oldSubscriptionId, string newSubscriptionId, INotification notification) { Console.WriteLine(notification); } //this even raised when a notification is successfully sent static void NotificationSent(object sender, INotification notification) { Console.WriteLine(notification); } //this is raised when a notification is failed due to some reason static void NotificationFailed(object sender, INotification notification, Exception notificationFailureException) { Console.WriteLine(notificationFailureException); } //this is fired when there is exception is raised by the channel static void ChannelException (object sender, IPushChannel channel, Exception exception) { Console.WriteLine(exception); } //this is fired when there is exception is raised by the service static void ServiceException(object sender, Exception exception) { Console.WriteLine(exception); } //this is raised when the particular device subscription is expired static void DeviceSubscriptionExpired(object sender, string expiredDeviceSubscriptionId, DateTime timestamp, INotification notification) { Console.WriteLine(notification); } //this is raised when the channel is destroyed static void ChannelDestroyed(object sender) { Console.WriteLine(sender); } //this is raised when the channel is created static void ChannelCreated(object sender, IPushChannel pushChannel) { Console.WriteLine(pushChannel); }