I didn't find this answer anywhere so decided to ask.
Does the Apple Push Notifications have a stats API or dashboard where we can see count for sent, received and opened?
Thanks.
Apple does not provide that kind of dashboard. When you are calling the APNS server to send a push notification you receive a response from the APNS server, that you can use to extract some statistics(mostly if the notification was send). If you need to know that the notification was opened you can manually track if the application was launched due to the user tapping the PN or an action of the PN.
Related
Currently, I have a GET method that unregisters push notification when the user logs out offline. I send the user's device token and API Key to the backend and that will unregister the user and disable push notifications. This works well, but there is one issue. If the user logs out offline, this won't work.
The only solution I came up with is to save the API key and device token and wait until the user comes back online. Then, I will send the API request. Not sure how good this solution is, but the only one I came up with that can work.
Edit: My biggest concern is unregistering push notifications when logging out offline which I haven't seen talked about on StackOverflow. Yes, I can unregister push notifications when user logs out, but not when they do it offline.
Edit 2: By unregisterting, I meant letting my server know not to send push notifications.
I don't see any other way than what you described in your question. What I would also do is call UIApplication.shared.unregisterForRemoteNotifications(). This will stop push notifications to a logged out user's phone, but will not alert your server of the unregister. Apple states in their docs that you can re-register to notifications after calling this method here.
When another user logs in you re-register for push notifications and link the device token to their account.
I googled but not able find my desired solution. My Questions are following related to push notification.
What if registered device turned off its push notification and server broadcast notification. Is notification place in waiting list (e.g when device turned on notification it gets notification) ? or Reject ? or Server keep sending ?
If server keep sending how to tackle this situation, I mean is there any way that we can find our some client turned off notification then we'll not send notification to APNS?
If someone already asked then kindly reference those question instead of down vote.
Looking for answer. Thanks
APNS docs here: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html#//apple_ref/doc/uid/TP40008194-CH8-SW1
Your server - what Apple calls the provider - maintains a list of device tokens that have registered for your notifications.
When a device turns off push notifications, you should remove its device token from your list.
So far as I know, if you attempt to push to a device that has turned off push notifications, your provider will receive an error, and the push notification will not be queued. It should be easy enough to test using a device.
I understand we can add code on iOS client side to detect whether the user has disabled push notification permission, my question it, is it possible to do it in only using APN?
I try the "Feedback Service" first, from Apple Programming Guide:
The Apple Push Notification service includes a feedback service to
give you information about failed remote notifications. When a remote
notification cannot be delivered because the intended app does not
exist on the device, the feedback service adds that device’s token to
its list. Remote notifications that expire before being delivered are
not considered a failed delivery and don’t impact the feedback
service. By using this information to stop sending remote
notifications that will fail to be delivered, you reduce unnecessary
message overhead and improve overall system performance.
FeedBack Service payload
So "Feedback Service" essentially give us a token list for failed push notifications. I tried to send push to a device with disabled push notification permission or app uninstalled , however my device token does not appear in this list.
Apple's document also mentions we will get immediate response from APN once we send the push notification:
If you send a notification that is accepted by APNs, nothing is
returned. If you send a notification that is malformed or otherwise
unintelligible, APNs returns an error-response packet and closes the
connection. Any notifications that you sent after the malformed
notification using the same connection are discarded, and must be
resent. Figure A-2 shows the format of the error-response packet.
However, it seems like the returned status stays the same no matter what I do: enable/disable push notification permission or even uninstall the app...
I fact, my hypothesis is that even the user has disabled the push notification, APN will still see it as a successful delivery, but iOS just simply don't show it. None of them response code from APN seem to be related to the disabled push notification.
I am wondering if there is a way to do it with APN? Thank you!
Reference: Apple Doc:https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/BinaryProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH13-SW1
I have an existing app that receives push notifications. I've been requested to implement a feature where the user must acknowledge the push notification. If the user does not acknowledge the notification, then they will be alerted again after a set time, until they finally do acknowledge it.
So far, the only solution I've come up with is:
We send a notification from our server to APNS. When the user opens the app after receiving a notification, the app will then send an acknowledgement back to the server. If the server does not receive an acknowledgement from the device within X minutes, it will automatically send another notification.
Is there a better way of implementing this kind of feature, where I'm not relying on sending acknowledgments back to the server?
Create Accept/Reject actions for push notification and save that info on server, so that we can differentiate the accepted ones and others
i have an app and i'm thinking about implementing push notifications in it. however, i want to use remote notifications. i've tried Parse's push notification service and it's great and works well. You can type any text you want to inform your users about and just press send in order to be delivered to all your App users. On the other hand, i don't know if Apple has any such service that can facilitate the process of sending remote notifications. so which is better to stick to, Apple or Parse? and can i have the same service as Parse from Apple?
Yes, you can get the same services as Parse. You have to build your own server that will talk with Apple APNS. Just for example sending a push notification from your own server without using parse is here.
I didn't understand what are you trying to ask.
You can use Apple push notification service for sending remote content. With Any content related to your App.
Check RemoteNotifications for details. Parse is also using the Apple's push notification service.
Edit: For implementing your own servers for push notification check this tutorial : Push Notification Services