当我删除我的 iOS 应用程序推送通知状态保持

问题描述:

当我第一次使用 Xcode 安装 iOS 应用程序时,我的 iPhone 会询问我是否要启用推送通知.

When I install my iOS application using Xcode for the first time, my iPhone asks whether I want to enable push notifications.

我可以发送通知,并且徽章会显示我发送的号码.

I am able to send a notification, and the badge shows a number that I sent.

当我从 iPhone 中删除应用程序并在 Xcode 中重建它并在我的 iPhone 上重新安装它时(使用 Xcode):

When I delete the application from my iPhone and rebuild it in Xcode and reinstall it again on my iPhone (using Xcode):

  • 设备不会询问我是否要启用推送.
  • 徽章就在那里,并且记住最后一个数字.
  • The device does not ask if I want to enable push.
  • The badge is there and remembers the last number.

我在新设备(安装了 IPA)上尝试了相同的应用程序,它要求我授予权限.

I tried the same application on a fresh device (installed the IPA) and it asked me for permissions.

如何让我的设备完全忘记应用程序?

How can I completely make my device forget the application?

谢谢

对此有一个解决方法,包括将系统时间提前两天,重新启动设备,然后将系统时间改回当前.iOS 旨在为每个应用程序每天仅请求一次推送许可.

There is a workaround for this that involves setting the system time ahead by two days, rebooting the device, and then changing the system time back to the present. iOS is designed to only ask permission for push once a day per application.

重置 iOS 上的推送通知权限警报 第一个当支持推送的应用程序注册推送通知时,iOS 会询问用户,如果他们希望接收该应用程序的通知.一旦用户已对此警报做出响应,除非设备已恢复或应用已卸载至少一天.

Resetting the Push Notifications Permissions Alert on iOS The first time a push-enabled app registers for push notifications, iOS asks the user if they wish to receive notifications for that app. Once the user has responded to this alert it is not presented again unless the device is restored or the app has been uninstalled for at least a day.

如果你想模拟你的应用程序的第一次运行,你可以离开应用卸载了一天.你可以在没有实际上通过将系统时钟向前设置一天来等待一天或更多,完全关闭设备,然后将设备转回来

If you want to simulate a first-time run of your app, you can leave the app uninstalled for a day. You can achieve the latter without actually waiting a day by setting the system clock forward a day or more, turning the device off completely, then turning the device back on.

http://developer.apple.com/library/ios/#technotes/tn2265/_index.html