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.
当用户从应用程序注销时,我必须从通知栏中清除所有远程/本地通知,而无需自己清除。我正在使用此代码清除通知,但它对我不起作用这是我的代码:
[[UIApplication sharedApplication] cancelAllLocalNotifications]; [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
看来您的代码是正确的。你仍然可以试试这个。
[UIApplication sharedApplication].applicationIconBadgeNumber = -1;
看到这个。