Open elliotbd opened 8 years ago
Hello! I have the same issue
But if i send 100 deviceToken per 1 broker session(start, stop) it will work.
i have the same issue!
i tested the certificate and the device using http://apns-gcm.bryantan.info/ and seems to work.
I have the same issue. I cannot send to more than 100 devices at a time. I will try to stop the broker every 100 devices in order to flush the queue and start it again for the next 100. I am hoping this works, but it is a kind of a hack. Has anyone found a better solution to this?
same here, wondering if there is any proper fix on this issue.
our notification server do auto scaling, I am wondering if there is any more robust work around then hard setting limits on number of devices.
I've been struggling the same issue over weeks now. In my case, there were a few device tokens which were not marked as expired by the Feedback Service somehow, so they did remain in our DB. After you try to enqueue a notification for a number of invalid tokens, Apple closes the connection, and PushSharp fails to deliver the rest of the messages, because it doesn't open a new connection in that case.
My solution was to set up the broker's event listener to log all device IDs and exception stack trace in the OnNotificationFailed event, and send one push for each device one-by-one, so by making a new connection for each to avoid Apple's connection refusal after a number of invalid devices. Then collected device IDs from the logs which received an "InvalidToken" or "Invalid DeviceToken" error in the AggregateException and marked them as invalid in the DB.
In my experience these devices somehow never get reported by the Feedback Service, so a possible solution is to invalidate/delete devices from the DB directly in the OnNotificationFailed event if the exception is an ApnsNotificationException and the status code is 8 (InvalidToken).
Hi. I have the same issue when I try send to 400 device with the same message in payload.
Hi, we have the same issue. Is there any workaround? aside from stopping and starting the broker? In our case we just leave the broker opened for the entire duration of the service
What version of PushSharp are you using?
4.0.10
Describe your issue:
Sending push notifications to APNS fails after 1,777 with the connection being closed by remote host.
This is similar to:
https://github.com/Redth/PushSharp/issues/609 (posted by mahdi but closed for V3.0 Beta 63). But user mahdi (https://github.com/mahdi) seems to be experiencing the same problem in PushSharp version 4.0.10 as I am:
http://www.simosh.com/article/dgfbfhbb-pushsharp-unable-to-write-data-to-the-transport-connection.html
What are the steps required to reproduce this issue?
Send 1,7777 APNS messages with the code fragment below with the payload of:
{"aps":{"alert":"Jerry and Judy XXXX: Practical Advice for Grandparents (Part 2 of 2)","badge":0}}
Please provide any Exception Stack Traces
2016-04-27 05:00:12.AM [INFO] APNS-CLIENT[1]: Retrying Batch: Batch ID=3, Error=System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.EndSend(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndWrite(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Security._SslStream.EndWrite(IAsyncResult asyncResult)
at System.Net.Security.SslStream.EndWrite(IAsyncResult asyncResult)
at System.IO.Stream.<>c.b__53_1(Stream stream, IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory
1.FromAsyncTrimPromise
1.Complete(TInstance thisRef, Func`3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization)--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at PushSharp.Apple.ApnsConnection.d__21.MoveNext()
2016-04-27 05:00:12.AM [INFO] APNS-Client[1]: Disconnecting (Batch ID=3)
Code Fragment