【问题标题】:ios Push Notifications not working if the user unintalled the app and then reinstalled it from the store?如果用户卸载应用程序然后从商店重新安装,ios 推送通知不起作用?
【发布时间】:2014-02-02 11:21:19
【问题描述】:

我遇到了 RegisterForRemoteNotifications 无法正常工作的异常情况。场景如下:

  • 用户首次从应用商店安装应用,RegisterForRemoteNotifications 完美运行。
  • 用户从他们的设备中删除了该应用,我也从我的服务器中删除了设备信息(令牌、ID、...等)。
  • 用户再次从应用商店重新安装应用,在这里我认为 RegisterForRemoteNotifications 不起作用并且用户令牌不会在我的服务器上注册。

这不准确吗?这个问题背后的原因可能是什么?

【问题讨论】:

  • 在这种情况下,用户必须手动同意首选项中的推送通知。与位置的行为相同。
  • @MirkoBrunner 将如何处理?这正常吗??!
  • 不幸的是,这很正常。一个好方法是在第一次运行时发出警报。所以用户要指出他必须手动同意推送服务。
  • @MirkoBrunner 我不确定这是否是最好的方法,根据苹果文档,方法 didRegisterForRemoteNotificationsWithDeviceToken 应该在每次应用程序运行时都有效。就我而言,它正在进行临时和开发,但不是商店上的版本.. 这太奇怪了。

标签: ios iphone objective-c ipad apple-push-notifications


【解决方案1】:

我发现了问题,即使用户卸载应用程序并重新安装它,应用程序也成功在我的服务器上注册,所以我不知道每次新安装设备 ID 都会更改。所以我在我的数据库中检查了错误的 ID。

【讨论】:

    猜你喜欢
    • 2020-04-08
    • 2013-01-29
    • 1970-01-01
    • 2019-11-17
    • 2011-07-08
    • 1970-01-01
    • 2020-02-23
    • 2014-11-15
    • 1970-01-01
    相关资源
    最近更新 更多