Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有推送通知设置。每次推送时,我都会增加图标徽章,然后在用户点击图标时消失。当用户点击图标时,有没有办法知道该徽章是否显示?如果显示徽章,我想转到特定视图。
我认为您需要在应用程序中自己跟踪它。您的代理应用程序:didFinishLaunchingWithOptions: 将在通知时调用,并且用户按下操作按钮并接收通知有效负载。
如果您的应用程序在前台运行,则代表 application:didReceiveRemoteNotification: 将被调用。在这种情况下,您可以拥有一个整数值并将其递增以跟踪您拥有的通知数量。它还接收通知有效负载
参考:http: //developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/IPhoneOSClientImp/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW1