处理 iOS 和 Android 上的推送通知场景 [英] Handling Push Notification scenarios on iOS and Android

查看:42
本文介绍了处理 iOS 和 Android 上的推送通知场景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为应用程序(iOS 和 Android)实现推送通知,并且需要对以下场景进行说明.

I want to implement Push Notification for an App (both iOS and Android) and need clarifications on the following scenarios.

我了解推送通知的一般工作原理和局限性.我确实阅读了文档,但这让我感到困惑并且没有回答我所有的问题.

I understand how the Push Notification works in general and the limitations. I did read the docs but that just got me confused and didnt answer all my questions.

在 iOS 和 Android 中如何处理以下场景:

How are the following scenarios handled in iOS and Android:

  • 设备关闭时
  • 当设备未连接到 3G 或 Wifi 网络时
  • 当设备崩溃需要重启时
  • 当应用程序在前台时
  • 当应用程序在后台时
  • 当用户当前正在使用应用程序时
  • 当我的应用关闭时(未打开/启动)
  • 当推送通知是特定于用户的并且两个用户共享相同的设备和应用时.示例:如果夫妻共用同一台设备并使用带有推送通知的银行应用.
  • 如果设备被多个用户共享,您可以发送用户特定的通知吗?
  • 当用户在多台设备上安装了应用程序
  • 您能否一次向用户注册的所有设备发送通知?
  • 您是否将设备类型(iOS 或 Android)与注册 ID 一起存储在用户表中,或者是否可以通过检查令牌或注册 ID 来区分设备类型?
  • 您能否取消之前发送的尚未阅读的通知并发送新通知?
  • Android 推送通知在 Kindle Fire 上不起作用并且需要实施 Amazon Device Messaging 吗
  • 还有什么我需要考虑或计划的吗?我知道处理取消注册和反馈服务

推荐答案

设备关闭时:

答案:IOS/Android 服务器(不是您的服务器)将处理何时发送推送通知.它检查设备是否可达.我们可以定义IOS/Android Server应该尝试发送多少次Push Notification.

Answer: IOS/Android Server (Not your Server) will handled when to send the Push Notification. It checks that device is reachable or not. We can define that how many times IOS/Android Server should try to send Push Notification.

当设备未连接到 3G 或 Wifi 网络时

答案:与 2G/3G/Wi-Fi 无关.设备应通过任何网络连接到 Internet.

Answer: Nothing related to 2G/3G/Wi-Fi. Device should be connected to Internet via any network.

当设备崩溃需要重启时

答案:IOS/Android 服务器检查设备是否可达.

Answer: IOS/Android Server checks that device is reachable or not.

当应用在前台时

答案:与前台应用无关.

Answer: Nothing related to app in foreground.

当应用在后台时

答案:与后台应用无关.

Answer: Nothing related to app in background.

当用户当前正在使用应用程序时

答案:与当前使用的应用无关.

Answer: Nothing related to app being used currently.

当我的应用关闭时(未打开/启动)

答案:没有关闭与应用相关的任何内容.

Answer: Nothing related to app is closed.

当推送通知是特定于用户的并且两个用户共享相同的设备和应用程序时.示例:如果夫妻共用同一台设备并使用带有推送通知的银行应用.

答案:这取决于您如何在您的服务器上实施.您将为每个用户管理设备 ID.因此,为多个用户发送到同一设备取决于您的实现逻辑.

Answer: It depends on how you have implemented on YOUR Server. You will be managing Device Id for each user. So it's upto your implementation logic to send to same device for multiple users.

如果设备被多个用户共享,你能发送用户特定的通知吗?

答案:这取决于您如何在您的服务器上实施.您将为每个用户管理设备 ID.所以这取决于你的实现逻辑.

Answer: It depends on how you have implemented on YOUR Server. You will be managing Device Id for each user. So it's upto your implementation logic.

当用户在多台设备上安装了应用程序

答案:这取决于您如何在您的服务器上实施.

Answer: It depends on how you have implemented on YOUR Server.

您能否一次向用户注册的所有设备发送通知?

答案:根据您的实现逻辑再次是.

Answer: Yes again as per your implementation logic.

您是否将设备类型(iOS 或 Android)与注册 ID 一起存储在用户表中,或者有没有办法通过检查令牌或注册 ID 来区分设备类型?

答案:是的,您需要存储设备类型,以识别您需要向哪个服务器(IOS/Android)发送推送通知请求.

Answer: Yes you need to store the device type, to identify to which Server (IOS/Android), you need to send request for Push Notification.

您能否取消之前发送的尚未阅读的通知并发送新通知?

答案:不,您不能取消请求.

Answer: No you cannot cancel the request.

Android 推送通知在 Kindle Fire 上不起作用并且需要实施 Amazon Device Messaging 是否仍然如此

答案:需要谷歌一下.

还有什么我需要考虑或计划的吗?我知道处理取消注册和反馈服务

答案:需要谷歌一下.

这篇关于处理 iOS 和 Android 上的推送通知场景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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