From 5f5230609d0f23b84bb013f145b9bc8d5bd5eda1 Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Sun, 12 May 2024 14:35:43 -0500 Subject: [PATCH] Added `Clear Notifications` Button (Settings.xm) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit a new button that will fix the issue for uYouEnhanced when Sideloading it. When interacting with this button it should help clear the notifications 🔔 Fixes #603 --- Sources/uYouPlusSettings.xm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Sources/uYouPlusSettings.xm b/Sources/uYouPlusSettings.xm index 751fad8..4df33a2 100644 --- a/Sources/uYouPlusSettings.xm +++ b/Sources/uYouPlusSettings.xm @@ -249,6 +249,19 @@ extern NSBundle *uYouPlusBundle(); ]; [sectionItems addObject:appIcon]; + YTSettingsSectionItem *clearNotifications = [%c(YTSettingsSectionItem) + itemWithTitle:LOC(@"Clear Notifications") + titleDescription:LOC(@"Force clear all notifications (Recommended if uYouEnhanced is Sideloaded)") + accessibilityIdentifier:nil + detailTextBlock:nil + selectBlock:^BOOL (YTSettingsCell *cell, NSUInteger arg1) { + [[UIApplication sharedApplication] cancelAllLocalNotifications]; + [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0]; + return YES; + } + ]; + [sectionItems addObject:clearNotifications]; + # pragma mark - App theme SECTION_HEADER(LOC(@"THEME_OPTIONS"));