From e9a706fa727fafb821d98975b0873dfc6af36b87 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Sun, 3 May 2026 01:26:12 +0200 Subject: [PATCH] fix(tvos): enable wakelock plugin --- pubspec.lock | 4 ++-- pubspec.yaml | 1 + tvos/Podfile | 2 +- tvos/Runner/AppDelegate.swift | 4 ++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 02b59194..0f9d09ba 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1407,8 +1407,8 @@ packages: dependency: "direct main" description: path: wakelock_plus - ref: HEAD - resolved-ref: "0085d705c80a961a4a5eeaa4ee8f723dcf4bc9b8" + ref: "8595fee595c952b73d430f2eab05f2e0d858290e" + resolved-ref: "8595fee595c952b73d430f2eab05f2e0d858290e" url: "https://github.com/edde746/wakelock_plus" source: git version: "1.4.0" diff --git a/pubspec.yaml b/pubspec.yaml index bdd8eeb9..6be6d67e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -37,6 +37,7 @@ dependencies: wakelock_plus: git: url: https://github.com/edde746/wakelock_plus + ref: 8595fee595c952b73d430f2eab05f2e0d858290e path: wakelock_plus path_provider: ^2.1.0 path: ^1.9.0 diff --git a/tvos/Podfile b/tvos/Podfile index c8628034..f6ac18b5 100644 --- a/tvos/Podfile +++ b/tvos/Podfile @@ -12,7 +12,7 @@ project 'Runner', { # compiled from tvos/Runner/Plugins/ via tvos/scripts/wire_plugins.rb. require 'json' -tvos_pod_plugins = %w[universal_gamepad os_media_controls] +tvos_pod_plugins = %w[universal_gamepad os_media_controls wakelock_plus] plugins_deps = File.expand_path('../.flutter-plugins-dependencies', __dir__) unless File.exist?(plugins_deps) diff --git a/tvos/Runner/AppDelegate.swift b/tvos/Runner/AppDelegate.swift index 7ab44e7e..4de7ab40 100644 --- a/tvos/Runner/AppDelegate.swift +++ b/tvos/Runner/AppDelegate.swift @@ -3,6 +3,7 @@ import UIKit import AVFoundation import universal_gamepad import os_media_controls +import wakelock_plus @main @objc class AppDelegate: FlutterAppDelegate { @@ -44,6 +45,9 @@ import os_media_controls if let r = self.registrar(forPlugin: "OsMediaControlsPlugin") { OsMediaControlsPlugin.register(with: r) } + if let r = self.registrar(forPlugin: "WakelockPlusPlugin") { + WakelockPlusPlugin.register(with: r) + } return super.application(application, didFinishLaunchingWithOptions: launchOptions) }