Know if the application received a notification from the server

I am creating a newspaper application, and I would like to know how many people received push push vs , how many actually read it .

I was thinking about implementing the way in which when an application receives a notification , it wakes up and sends a request to the server saying " Hi, I _____, I received a notification about article ____ " and save it in the database. Then, if the user clicks on the notification and proceeds to reading the article, I send another request: " Hi, I ____, and I read the article _____ ", and also saved it in the database. Subsequently, with some requests I can understand the percentage of read / received.

I don’t understand whether it is even possible to wake up the application , even if it was not opened by the user after a while, and send a request to the server (for the background, it means that the application does not start or is in cache?)

I would like to achieve what they did with Whatsapp:

  • I get a new message about Whatsapp
  • I do not open the application
  • I go to whatsapp web
  • I am opening a conversation on the WhatsApp website
  • The icon and phone notification disappear because I'm reading it somewhere else.

I think this feature is achieved using silent push notifications that simply update the application icon and clear the read notification.

+8
android ios push-notification notifications apple-push-notifications
source share
7 answers

Apple Developer Technical Support Response:

Hi Matteo,

Thank you for contacting Apple Developer Technical Support (DTS). Our engineers reviewed your request and came to the conclusion that there is no supported way to achieve the desired functionality, given the current configuration of the delivery system.

So, at the end of the games DO NOT NEED

+2
source share

This is a very good question on how to implement such silent notifications. There are several variables here that we need to consider and handle differently.

Push notifications sent to users . Some of them would get it. Some may not get it at all.

Pressing multiple notifications to the same user for a short period of time . It’s difficult here to keep track of the exact notification of the user who opened the application. Because the user could read all the news that received notifications in one attempt.

The actual content displayed to the user in the application . The user could open the application due to notifications. Sometimes he could see notifications, and then open the application directly, without interacting with notifications.

So it could be an implementation.

  • Implement push notifications for the application
  • The user receives push notifications, and the notification icon shows Number (1).
  • Now, when the user views the same news on any other medium (your own Mac application or PC application). The server is notified of user actions and news that he / she / who has just read.
  • Now the server knows that it sent a notification and it is not readable. When you receive a reading notification, you can send a remote notification that can be processed by the application in the background and update the icon.

Check out this link for more details on how to handle notifications in different modes.

Apple's documentation can also be attributed here for the background - remote notification.

So, you will run your application in the background with certain settings in order to respond to quiet notifications and update the icon in the same way as WhatsApp. Hope this helps.

+4
source share
+2
source share

I have already implemented such a thing in one of my applications, and it is really complicated. You will have many use cases.

  • First (but it looks like you already know this): Apple does not provide any callback to say: “this notification has been sent”

  • Second: when your application is killed (not even in the background), nothing can be done with a notification , which means that your application will not be able to wake up and read the notification and do something. The only thing you can do is change the number of the icon, even if your application is killed.

  • Third: when your application is in the background, you can wake up your application for 30 seconds. During this time, you can send a request to the server, but if it takes too long, the process will be destroyed by the OS.

Having said that, briefly explain how you can implement the system:

  • You will need it on the server side to save any notifications that have been sent to your database. Once they are sent, save them as "pending"
  • On the application side: if your application is in the background , as soon as a notification is received, you can wake the application to send a request to the server. Then, in your database, your notification status will change to "receive" or "notification." If your application was killed when the user launched the application, send a request to the server to request all notifications in the standby state, so your application will be updated, as well as the number of your icon.
  • If the user clicks on the notification, this will open your application directly in the article, so you can send a request and tell your server that the article has been received and read.
  • If the user has read your article on a web page, send a notification. Set the notification icon number with the number of actual "pending" notifications in your database.

Hope this helps you in addition to @Prav's answer :)

+2
source share

You want to synchronize your application with a web application or a website, than when you send a notification to the application, than set a notification on a specific identifier. If the user reads this message from your website, resend the push notification with another message and a descriptor in the service or broadcast the receiver after that, cancel the notification if the received message contains another message. You can also use Notification Listener.Refer this link

Send the link for ios.

+1
source share

I don’t know about Apple notification, I don’t know how to find out how many users have received your notification. But know how to find how they read it. send link to image link 1X1 pixel. when opening a notification. upload a link to the image (hidden, it will not accept any significant data, calling it only 1X1-pixel), for example

www.yoursite.com/loadArticleImg?AId=articleId&userId=userId 

server side save articleId with userId and return imgData (1X1) it will work

0
source share

Hi @Smile Applications after reading your question I suggest you see the OneSignal site. OneSignal lets you send notifications to your subscribers. It will also show you how many users are using your application and how many have received your notifications. If you want to send notifications and track them from the application itself, you can use their API . It’s easy, and I will implement it on Android and will be implementing it on iOS soon.

Now the second part of your question about how to find out how many users have read / opened your notification and what activity they are on, you can use Google Analytics . This will allow you to see from which part of the world your users are using your application and what actions your application opens the most. It is also easy, and I will also implement it on Android, and I will soon be implementing it on iOS too.

0
source share

All Articles