如何增加重复本地通知的应用程序徽章编号(iPhone)

编程入门 行业动态 更新时间:2024-10-27 11:21:51
本文介绍了如何增加重复本地通知的应用程序徽章编号(iPhone)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经设置了每分钟重复的本地通知,但是我需要每次都增加应用程序徽章编号。当我运行它的时候它似乎没有增加,它只是保持1.请有人可以帮助我吗?

I've setup a local notification that repeats every minute, however I need the application badge number to increment each time. When I run it at the moment it doesn't seem to increase, it just stays a 1. Please can someone help me out?

以下是我创建通知的方法:

Here is how I create the notifications:

// Create the UILocalNotification UILocalNotification *myNotification = [[UILocalNotification alloc] init]; myNotification.alertBody = @"Blah blah blah..."; myNotification.alertAction = @"Blah"; myNotification.soundName = UILocalNotificationDefaultSoundName; myNotification.applicationIconBadgeNumber++; myNotification.timeZone = [NSTimeZone defaultTimeZone]; myNotification.repeatInterval = NSMinuteCalendarUnit; myNotification.fireDate = [[NSDate date] dateByAddingTimeInterval:30]; [[UIApplication sharedApplication] scheduleLocalNotification:myNotification];

推荐答案

经过大量的研究后,我发现解决方案是没有解决方案:

After doing lot's of research I figured out the solution is that there is no solution:

iPhone:通过本地通知增加应用程序徽章

无法动态更新徽章编号您的应用在后台时的本地通知。您必须使用推送通知。

更多推荐

如何增加重复本地通知的应用程序徽章编号(iPhone)

本文发布于:2023-11-27 02:50:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636257.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:徽章   应用程序   编号   通知   iPhone

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!