{"action":"opened","issue":{"url":"https://api.github.com/repos/Ph3nol/NotificationPusher/issues/54","labels_url":"https://api.github.com/repos/Ph3nol/NotificationPusher/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/Ph3nol/NotificationPusher/issues/54/comments","events_url":"https://api.github.com/repos/Ph3nol/NotificationPusher/issues/54/events","html_url":"https://github.com/Ph3nol/NotificationPusher/issues/54","id":54549743,"number":54,"title":"This library is not suitable for APNS when sending a large number of notifications","user":{"login":"jsaade","id":182048,"avatar_url":"https://avatars.githubusercontent.com/u/182048?v=3","gravatar_id":"","url":"https://api.github.com/users/jsaade","html_url":"https://github.com/jsaade","followers_url":"https://api.github.com/users/jsaade/followers","following_url":"https://api.github.com/users/jsaade/following{/other_user}","gists_url":"https://api.github.com/users/jsaade/gists{/gist_id}","starred_url":"https://api.github.com/users/jsaade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsaade/subscriptions","organizations_url":"https://api.github.com/users/jsaade/orgs","repos_url":"https://api.github.com/users/jsaade/repos","events_url":"https://api.github.com/users/jsaade/events{/privacy}","received_events_url":"https://api.github.com/users/jsaade/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-16T08:04:15Z","updated_at":"2015-01-16T08:04:15Z","closed_at":null,"body":"Hi,\r\n\r\nI have noticed that the APNS adapter opens and closes a connection for each message to each device.\r\nThis will be treated as DOS attack by APNS when having a large number of devices.\r\n\r\nConsider the example of a news site that needs to send 1 new push to 50k devices, this library is opening and closing 50k connections. This has 2 implications:\r\n1- APNS servers will block the connections\r\n2- The push will take ages to be sent and delivered (they are sent one by one and you have around 0.5 seconds delay when initialising a connection, this means the push will take around 7 hours to be all sent).\r\n\r\nApple has actually specified how to send these messages in one connection:\r\nhttps://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html#//apple_ref/doc/uid/TP40008194-CH101-SW4\r\n\r\nThanks"}}