is_tv_ffi 0.7.1
is_tv_ffi: ^0.7.1 copied to clipboard
Detects whether a Flutter app is running on a TV: Android TV, tvOS, webOS, Tizen and TV-mode Linux and Windows, using FFI and JNI rather than platform channels.
0.7.1 #
Changes #
- Android: migrated to built-in Kotlin. The plugin no longer applies the Kotlin Gradle Plugin; Flutter supplies Kotlin itself. Apps using this plugin no longer get the warning that "Future versions of Flutter will fail to build if your app uses plugins that apply KGP"
- Updated the minimum supported SDK version to Flutter 3.44 / Dart 3.12
- Dropped the unused
kotlin-testdependency, which relied on the Kotlin Gradle Plugin to supply its version - CI: bumped the GitHub Actions off Node 20, which is deprecated on GitHub runners —
checkoutto v7,setup-javato v5,setup-androidto v4 andsetup-gradleto v5 - Linux/Windows: bumped the googletest used by the native unit tests from 1.11.0 to 1.15.2. 1.11.0 declares
cmake_minimum_required(VERSION 2.8.12), and CMake 4 removed compatibility with anything below 3.5, so configuring the example failed on runners that ship CMake 4. This affects the plugin's own test build only — the googletest dependency is behindinclude_is_tv_ffi_tests, which is set by the example app and not by consuming apps
Note for contributors: because Flutter now supplies Kotlin, android/ is no longer buildable on its own. Run the Android unit tests through the example app instead:
cd example/android && ./gradlew :is_tv_ffi:test
0.7.0 #
Fixes #
- Android: fixed
isTvthrowingUseAfterReleaseErroron every read after the first. The applicationContextwas cached and then released byuse, so the second and later reads operated on a deleted JNI reference. Each read now acquires and releases its own reference - iOS/macOS: a missing or stripped
is_tvsymbol is now reported when the library is resolved instead of surfacing as a bareArgumentErroron the first call, and the original stack trace is preserved - Web:
shieldandaftare no longer matched as bare substrings. A Shield Tablet is no longer reported as a TV, and user agents that merely contain "aft" (for example "Craft") no longer match. Fire TV model codes are matched as whole words instead - Linux/Windows:
FLUTTER_IS_TVis now matched case-insensitively and also acceptsyesandon, soFLUTTER_IS_TV=TRUEworks as documented - iOS/macOS: the
PrivacyInfo.xcprivacymanifests are now actually bundled —resource_bundleshad been left commented out, so they shipped with neither platform
Changes #
- Breaking: iOS and macOS moved to Swift Package Manager and no longer ship a podspec. Flutter warned that the plugin did not support SPM and that this "will become an error in a future version of Flutter". The Swift sources now live in
<platform>/is_tv_ffi/Sources/is_tv_ffi/alongside aPackage.swift. Apps must be on Flutter 3.44 or newer with Swift Package Manager enabled — it is on by default there. Apps that have disabled SPM, globally or viaenable-swift-package-manager: falsein theirpubspec.yaml, must re-enable it - Upgraded dependencies:
jnito ^1.0.0,mocktailto ^1.0.5,flutter_lintsto ^6.0.0,jnigento ^0.16.0, andffigento ^20.1.1 - Added
jni_flutter^1.0.1 dependency; the Android application-context API moved there injni1.0.0 - Moved
mocktailtodev_dependencies(it was incorrectly declared as a runtime dependency) - Windows: removed the unreliable
USERNAME == "SYSTEM"heuristic; TV detection on Windows now relies solely on theFLUTTER_IS_TVenvironment variable - Web: detect Samsung/LG smart-TV platform globals (
tizen,webOS,webOSSystem) in addition to the user agent, and broadened the TV user-agent keyword list (HbbTV, Bravia, VIDAA, Roku, Net TV, CE-HTML, Opera TV) - Android:
UiModeManageris now resolved with a safe cast, and detection falls back to theFEATURE_LEANBACKsystem feature for TV boxes that report a non-television UI mode - Linux: Steam Big Picture detection now also recognises SteamOS sessions, gamescope sessions and the
SteamDeckvariable IsTvFfinow has aconstconstructor- Raised the plugin's Android build toolchain to Gradle 8.14, Android Gradle Plugin 8.11.1, and Kotlin 2.2.20; building for Android now requires Gradle 8.13 or newer
- Raised
compileSdkto 36, moved thedependenciesblock out ofandroid { }, replaced the deprecatedkotlinOptionswithkotlin { compilerOptions }, and dropped the deprecatedpackageattribute from the library manifest - Raised the Apple deployment targets to iOS 13.0 and macOS 10.15
- The example app no longer uses CocoaPods at all: its
Podfiles are deleted and the Pods references are removed from both Xcode projects - Breaking: Raised minimum Flutter to >=3.44.0, for Swift Package Manager (previously >=3.35.6, required by
jni1.0.0)
Internal #
- Collapsed the four identical iOS/macOS/Linux/Windows FFI wrappers and their generated bindings into a single
IsTvNativeimplementation and oneffigen.yaml; the platform lookup is now aswitchinstead of a mutable global factory map - Web: replaced the test-only
userAgentparameter onisTv()— which changed production behaviour and silently required a pre-lowercased string — with a purematchesTvUserAgentmatcher - Platform implementations now resolve their native dependencies lazily, so constructing one never touches JNI or FFI
- CI now also runs the Kotlin unit tests, the Linux and Windows gtest suites, the example widget tests, a formatting check, an analyzer pass over the example, and a publish dry-run
- Added a
.pubignoreso generator configs and the Gradle wrapper are not published - Rewrote the example app: it no longer wraps a synchronous getter in an
asyncmethod with an unreachablePlatformExceptionhandler