feat(android-tv): TV recommendations (#1575)

This commit is contained in:
Steve Byatt
2026-05-21 12:55:26 +01:00
committed by GitHub
parent 121ff0eea0
commit 11a4f14732
18 changed files with 923 additions and 128 deletions

View File

@@ -0,0 +1,26 @@
import { requireNativeModule } from "expo-modules-core";
import { Platform } from "react-native";
import type { TvRecommendationsModuleType } from "./TvRecommendations.types";
let TvRecommendationsModule: TvRecommendationsModuleType | null = null;
if (Platform.OS === "android" && Platform.isTV) {
try {
TvRecommendationsModule =
requireNativeModule<TvRecommendationsModuleType>("TvRecommendations");
} catch {
TvRecommendationsModule = null;
}
}
export function syncTvRecommendations(json: string): boolean {
return TvRecommendationsModule?.syncRecommendations(json) ?? false;
}
export function clearTvRecommendations(): boolean {
return TvRecommendationsModule?.clearRecommendations() ?? false;
}
export function refreshTvRecommendations(): boolean {
return TvRecommendationsModule?.refreshRecommendations() ?? false;
}