I understand that we can add code on the client side of iOS to determine if the user has disabled push notification, my question is, can this only be done using APN?
First I'll try the “feedback service,” from the Apple programming guide:
Apple Push Notification includes a feedback service to provide information about failed remote notifications. When a remote notification cannot be delivered because the intended application does not exist on the device, the feedback service adds that the device tokens list it. Remote notifications that expire before they are delivered are not considered unsuccessful delivery and do not affect the provision of feedback. Using this information to stop sending remote notifications that will not be delivered, you reduce unnecessary messages and improve overall system performance.
FeedBack Service Payload
So, the Feedback Service essentially gives us a list of tokens for failed push notifications. I tried to send push to the device with the push notification notification or application uninstall turned off, however my device token does not appear in this list.
The Apple document also mentions that we will immediately receive a response from the APN after sending the push notification:
If you send a notification received by APN, nothing happens returned. If you send a notification that is incorrect or otherwise illegible APNs will return an error packet and close the connection. Any notifications sent after rejection of a notice using the same connection are discarded and should be outraged. Figure A-2 shows the format of the error-response packet.
, , , : / push- ...
, , push-, APN , iOS . APN, -, push-.
, APN? !
: Apple Doc: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/BinaryProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH13-SW1