From 00585c7912e4e5fc50ee4a5214b0845258bad2cd Mon Sep 17 00:00:00 2001 From: "aricloverGitHub (INACTIVE)" <78001398+arichornlover@users.noreply.github.com> Date: Wed, 15 Jan 2025 20:40:21 -0600 Subject: [PATCH] =?UTF-8?q?Disable=20=E2=80=9CLive=20Activities=E2=80=9D?= =?UTF-8?q?=20(iOS=2016+)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/uYouPlus.xm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index e8f17e5..93f14b8 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -17,6 +17,31 @@ NSBundle *uYouPlusBundle() { NSBundle *tweakBundle = uYouPlusBundle(); // +// Disable Live Activities (iOS 16+) +NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier]; + +if (@available(iOS 16.0, *)) { + if (![bundleIdentifier isEqualToString:@"com.google.ios.youtube"]) { + Activity *activity = [[Activity alloc] initWithActivityType:@"com.google.ios.youtube.liveactivity"]; + [activity setContent:yourActivityContent]; + + [Activity startActivity:activity completionHandler:^(BOOL success, NSError * _Nullable error) { + }]; + + [activity updateContent:updatedActivityContent]; + + [activity endActivity]; + } else { + NSLog(@"Live activities are disabled for the YouTube app."); + + [UIApplication sharedApplication].applicationSupportsShakeToEdit = NO; + [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; + NSLog(@"Dynamic Island notifications are disabled for the YouTube app."); + } +} else { + NSLog(@"Live activities and Dynamic Island notifications are not applicable."); +} + // Notifications Tab appearance UIImage *resizeImage(UIImage *image, CGSize newSize) { UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0);