@react-native-tvos/config-tv 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -66,6 +66,7 @@ _Plugin parameters_:
66
66
  - `DEBUG=expo:react-native-tvos:config-tv` (shows debug messages from this plugin only)
67
67
  - `tvosDeploymentTarget`: (optional string, default '13.4') Used to set the tvOS deployment target version in the Xcode project.
68
68
  - `removeFlipperOnAndroid`: (optional boolean, default true) Used to remove the Flipper dependency from `MainApplication.kt` (or `MainApplication.java`) and `android/app/build.gradle`. This is necessary for React Native TV 0.73 and higher, since Flipper integration is removed from these versions. If this causes issues, set the value to false, run `npx expo prebuild --clean` again, and then remove Flipper from your Android source manually. This change will be made regardless of the setting of the `EXPO_TV` environment variable or the value of the `isTV` plugin parameter, as it is needed for both Android mobile and Android TV.
69
+ - `androidTVRequired`: (optional boolean, default false) If set, the Android manifest will be configured for Android TV only (no Android mobile support). Specifically, the "uses-feature" tag for "android.software.leanback" will be set to "required=true".
69
70
  - `androidTVBanner`: (optional string) If set, this should be a path to an existing PNG file appropriate for an Android TV banner image. See https://developer.android.com/design/ui/tv/guides/system/tv-app-icon-guidelines#banner . The Android manifest will be modified to reference this image, and the image will be copied into Android resource drawable directories.
70
71
  - `appleTVImages`: (optional object) If set, this is an object with the paths to images needed to construct the Apple TV icon and top shelf brand assets. The images will be used to construct a brand asset catalog in the Xcode project Image catalog, and the project updated to use the brand assets as the source for the app icons. If this property is set, all image paths must be defined and the files must exist, or an error will be thrown. The images need to be the exact sizes shown here, in order to avoid errors during Xcode compilation and on submission to the App Store or TestFlight.
71
72
  - `icon`: (string) Path to a 1280x760 image
package/build/types.d.ts CHANGED
@@ -55,6 +55,13 @@ export type ConfigData = {
55
55
  * the value of the `isTV` plugin parameter, as it is needed for both Android mobile and Android TV.
56
56
  */
57
57
  removeFlipperOnAndroid?: boolean;
58
+ /**
59
+ * If set, the Android manifest will be configured for Android TV only
60
+ * (no Android mobile support).
61
+ * Specifically, the "uses-feature" tag for "android.software.leanback"
62
+ * will be set to "required=true".
63
+ */
64
+ androidTVRequired?: boolean;
58
65
  /**
59
66
  * If set, this should be a path to an existing PNG file appropriate for an Android TV banner image.
60
67
  * See https://developer.android.com/design/ui/tv/guides/system/tv-app-icon-guidelines#banner
@@ -3,6 +3,7 @@ export declare const packageNameAndVersion: string;
3
3
  export declare function isTVEnabled(params: ConfigData): boolean;
4
4
  export declare function tvosDeploymentTarget(params: ConfigData): string;
5
5
  export declare function shouldRemoveFlipperOnAndroid(params: ConfigData): boolean;
6
+ export declare function isAndroidTVRequired(params: ConfigData): boolean;
6
7
  export declare function androidTVBanner(params: ConfigData): string | undefined;
7
8
  export declare const appleTVImageTypes: string[];
8
9
  export declare function appleTVImagePathForType(params: ConfigData, imageType: string): string | undefined;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appleTVImagePathForType = exports.appleTVImageTypes = exports.androidTVBanner = exports.shouldRemoveFlipperOnAndroid = exports.tvosDeploymentTarget = exports.isTVEnabled = exports.packageNameAndVersion = void 0;
3
+ exports.appleTVImagePathForType = exports.appleTVImageTypes = exports.androidTVBanner = exports.isAndroidTVRequired = exports.shouldRemoveFlipperOnAndroid = exports.tvosDeploymentTarget = exports.isTVEnabled = exports.packageNameAndVersion = void 0;
4
4
  const getenv_1 = require("getenv");
5
5
  class Env {
6
6
  /** Enable prebuild for TV */
@@ -24,6 +24,10 @@ function shouldRemoveFlipperOnAndroid(params) {
24
24
  return params?.removeFlipperOnAndroid ?? true;
25
25
  }
26
26
  exports.shouldRemoveFlipperOnAndroid = shouldRemoveFlipperOnAndroid;
27
+ function isAndroidTVRequired(params) {
28
+ return params?.androidTVRequired ?? false;
29
+ }
30
+ exports.isAndroidTVRequired = isAndroidTVRequired;
27
31
  function androidTVBanner(params) {
28
32
  return params?.androidTVBanner;
29
33
  }
@@ -120,7 +120,7 @@ function addTouchscreenHardwareFeatureToManifest(_config, androidManifest, param
120
120
  androidManifest.manifest['uses-feature']?.push({
121
121
  $: {
122
122
  'android:name': 'android.software.leanback',
123
- 'android:required': 'false',
123
+ 'android:required': (0, utils_1.isAndroidTVRequired)(params) ? 'true' : 'false',
124
124
  },
125
125
  });
126
126
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-tvos/config-tv",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Config plugin to reconfigure native directories for Apple TV and Android TV development if needed",
5
5
  "main": "build/withTV.js",
6
6
  "types": "build/withTV.d.ts",