如何捕捉所有iOS推送通知不同的用户行为,包括对应用程序图标自来水 [英] How to catch all iOS Push Notifications with different user actions including tap on app icon

查看:100
本文介绍了如何捕捉所有iOS推送通知不同的用户行为,包括对应用程序图标自来水的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据苹果指南:

作为presented通知的结果,用户点击警报或抽头(或点击)的应用程序图标的操作按钮。
如果操作按钮被窃听(运行iOS的设备上),系统启动应用程序和应用程序调用其委托的应用中:didFinishLaunchingWithOptions:方法(如果实现的话);它通过在通知有效载荷(用于远程通知)或本地通知对象(本地通知)。

"As a result of the presented notification, the user taps the action button of the alert or taps (or clicks) the application icon. If the action button is tapped (on a device running iOS), the system launches the application and the application calls its delegate’s application:didFinishLaunchingWithOptions: method (if implemented); it passes in the notification payload (for remote notifications) or the local-notification object (for local notifications).

如果该应用程序图标运行iOS的设备上拍了拍,应用程序调用相同的方法,但配料没有关于通知信息。如果点击运行Mac OS X的计算机上的应用程序图标,应用程序调用委托的applicationDidFinishLaunching:方法,其中委托可以获得远程通知负载

If the application icon is tapped on a device running iOS, the application calls the same method, but furnishes no information about the notification . If the application icon is clicked on a computer running Mac OS X, the application calls the delegate’s applicationDidFinishLaunching: method in which the delegate can obtain the remote-notification payload."

我的问题是
假设用户接到提供商3-4推送通知和所有存储在苹果的通知中心。如果用户在通知提醒窃听,他/她可以很容易地在应用程序的通知数据。但是,如果用户在iPhone上挖掘的应用程序图标,如何让所有的一切previous通知相关的数据。

My question is Suppose user got 3-4 Push notifications from provider and all are stored in apple's notification center. If user tapped on notification alert, he/she can easily get the notification data in the app. But if user tapped app icon on iPhone, how to get all the data related of all previous notifications.

在此先感谢!

推荐答案

您不能,你只会收到有关被用来打开应用的通知信息。

You can't, you will only receive information about the notification that was used to open your app.

所以,如果用户打开您的应用程序,你的应用程序有通知,您将无法从与你的应用程序检索它们。

So if a user opens your app, and your app has notifications, you will not be able to retrieve them from with in your app.

一个变通可能还保持在服务器上轨道的通知,并在应用程序处理这个问题。因此,服务器将在其通知已读轨道。这是Facebook的是怎么做的。

A work around could be to also keep track of notification on a server and handle this with in the app. Thus the server keeps track on which notification has been read. This is how Facebook does it.

这篇关于如何捕捉所有iOS推送通知不同的用户行为,包括对应用程序图标自来水的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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