知道应用程序是否收到了服务器端的通知 [英] Know if the app received the notification from server side

查看:27
本文介绍了知道应用程序是否收到了服务器端的通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个类似报纸的应用程序,我想知道有多少人收到了文章的推送通知实际阅读了多少人.

I'm building a newspaper-like app and I would like to know how many people received the article's push notification vs how many actually read it.

我想实现一种方法,当收到通知时,应用程序唤醒并向服务器发送请求,说我是 _____,我收到了文章____的通知"并将其存储在数据库中.然后,如果用户点击通知并阅读文章,我会发送另一个请求,说我是____,我已经阅读了文章_____",并将其存储在数据库中.之后通过一些查询,我能够了解读取/接收的百分比.

I was thinking to implement a way in which when the notification is received the app wakes up and send a request to the server saying "Hi I'm _____, I've received the notification of the article ____" and store it in the database. Then afterwards if the user click on the notification and goes to read the article I send another request saying "Hi I'm ____ and I've read the article _____" and I also store it on the database. Afterwards with some queries I'm able to understand the percentage read/received.

我不明白是否可以唤醒应用程序,即使用户在一段时间内没有打开它并向服务器发送请求(背景意味着应用程序未启动或在缓存中?).

I don't understand if it's even possible to wake up the app even if it was not opened by the user in a while and send a request to the server (for background is meant that the application is not launched or that is in the cache ?).

我想实现他们用 Whatsapp 所做的:

I would like to achieve what they did with Whatsapp:

  • 我在 Whatsapp 上收到一条新消息
  • 我没有打开应用
  • 我去 WhatsApp 网站
  • 我在 WhatsApp 网页上打开对话
  • 手机上的徽章和通知消失了,因为我在其他地方读到过

我认为该功能是通过静默推送通知实现的,只需更新应用徽章并清除已读通知.

I think that that feature is achieved with silent push notifications that just update the app badge and clear the read notification.

推荐答案

Apple 开发者技术支持回复:

Reply from Apple Developer Technical Support:

你好马特奥,

感谢您联系 Apple 开发者技术支持 (DTS).我们的工程师已审核您的请求,并得出结论认为,鉴于当前交付的系统配置,没有支持的方法来实现所需的功能.

Thank you for contacting Apple Developer Technical Support (DTS). Our engineers have reviewed your request and have concluded that there is no supported way to achieve the desired functionality given the currently shipping system configurations.

所以在游戏结束时这是不可能的

So at the end of the games IT'S NOT POSSIBLE

这篇关于知道应用程序是否收到了服务器端的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆