在午夜的选项更新应用徽章:应用程序未启动或背景,徽章数量可能减少 [英] Updating application badge at midnight with options: app not launched or in background, badge number can decrease

查看:181
本文介绍了在午夜的选项更新应用徽章:应用程序未启动或背景,徽章数量可能减少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在阅​​读有关本地通知,他们可以帮助更新的应用工号的方式很多东西。

I'm reading many things about Local Notifications and the way they can help to update the app badge number.

我想更新这个徽章在午夜,并将其值设置为一个数字我不能在午夜前知道。所以我想,如果可能的话,要在午夜将升级/加载某些DATAS,检查显示数字发射功能,并在标志中显示它。

I'd like to update this badge at midnight, and set its value to a number I can't know before midnight. So I'd like, if possible, to launch a function at midnight that would update/load some datas, check the number to display, and display it on the badge.

当然,要显示的数目不相对于所述显示的数字,并且可以是较低或更大。

Of course, the number to display is not relative to the displayed number, and can be lower or greater.

这是预期工作:
- 当应用程序在后台
- 当应用程序是在前台
- 当应用程序未启动

This is expected to work : - When app is in background - When app is in foreground - When app is not launched

你会知道的方式做到这一点,甚至部分?如果没有可能,让说,我可以把事情知道午夜前的工号...这会帮助你工作的答案吗?这不是想要的,但如果我没有选择,使这项工作,我打算写吨无用code要做到这一点...

would you know a way to do this, even partially ? If not possible, let say I can make things to know the badge number before midnight... Would this help you for a working answer ? This is not wanted, but if I don't have the choice to make this work, I'll plan to write tons of useless code to do this...

推荐答案

除非你的应用程序安装到的官多任务情况之一(VOIP,地点和背景音乐),你将能的唯一途径动态设置,当你的应用程序没有运行与推送通知的徽章数量...应用程序无法响应本地通知运行code(直到用户$ p $在psses查看按钮通知弹出,至少)。

Unless your application fits into one of the "official" multitasking cases (VOIP, location, and background audio), the only way you're going to be able to dynamically set the badge number when your application isn't running is with push notifications... applications can't run code in response to a local notification (until the user presses the "View" button in the notification popup, at least).

请参阅http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html一切你所能想了解本地和iOS中推送通知。

See http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html for everything you could ever want to know about local and push notifications in iOS.

这篇关于在午夜的选项更新应用徽章:应用程序未启动或背景,徽章数量可能减少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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