IOS消本地通知 [英] IOS Cancelling Local Notifications

查看:259
本文介绍了IOS消本地通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不喜欢问模糊的问题,但我不能准确地告诉是什么问题。

I dont like asking vague questions but I couldnt exactly tell what the problem is.

在我的应用我设置一些日常的本地通知。在拍摄200PM每天。我后来删除了将本地通知的codeS,并添加推送通知功能。

In my app I set some daily local notifications. Shooting everyday at 200PM. I later removed the codes that sets the local notifications, and added push notification feature.

我测试推和它的作品(每当我想)。但我仍然使用旧的通知为好,难道是因为我把他们前面的地方手机本身。有没有办法取消它们无需编码。例如是他们取消,如果我删除的应用程序?

I test the push and it works (whenever I want to). But I still get the old notifications as well, could it be because I set them earlier somewhere on the phone itself. Is there a way to cancel them without coding. For example are they cancelled if I remove the app?

推荐答案

卸载应用程序会删除本地通知,虽然有些人报告说,他们正在缓存长达24小时(所以如果你删除的应用,不要 ŧ重新安装超过24小时),请参见这里了解更多详情。

Uninstalling the app will remove the local notifications, although some people have reported that they are cached for up to 24 hours (so if you delete the app, don't reinstall it for more than 24 hours) See here for more details.

另外,如果你仍然有机会获得code可以取消所有的本地通知是这样的:

Otherwise, if you still have access to the code you can cancel all local notifications like this:

[[UIApplication sharedApplication] cancelAllLocalNotifications];

这篇关于IOS消本地通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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