We are currently developing a WebAPI service that uses APNs (HTTP/2) to send push notifications to iOS devices. (Using PushSharp's HTTP/2 support) The WebAPI service is running on IIS using .net framework 4.8 and c#.
The connection to APNs is always maintained, and the connection is checked every 30 minutes using a dummy token Ping. KeepAlivePeriod = 30 minutes and KeepAliveRetryPeriod = 10 seconds have also been set. However, the following issues are occurring.
- Although the Ping sent immediately before was successful, a TimeoutException occurs in the notification request sent a few minutes later.
- There is no explicit disconnection notification from APNs, and the connection appears to be silently disconnected.
- Once a TimeoutException occurs, it occurs frequently afterwards.
Below is an excerpt from the log.
Apple Notification Failed for some unknown reason 1-1: One or more errors occurred.
Apple Notification Failed for some unknown reason 1-2:System.TimeoutException: The operation timed out.
In light of this issue, I would like to be advised on the following two points.
- Are there any official specifications regarding the lifecycle and expiration date of APNs HTTP/2 connections?
Even if pings are sent periodically, is there a timeout or other setting that disables the connection on the APNs side? - What are the conditions that would cause APNs to silently terminate a connection?
For example, could this be due to inactivity, TLS restrictions, network maintenance, etc.?
If you have any official documentation or technical guidelines to improve the reliability of this system, we would appreciate it if you could share them with us.
Thank you in advance.