expo / config-plugins

Out-of-tree Expo config plugins for packages that haven't adopted the config plugin system yet.
472 stars 102 forks source link

feat(tv): Add TV plugin (@config-plugins/tv) #194

Closed douglowder closed 1 year ago

douglowder commented 1 year ago

Why

We need a way to allow Expo users to modify their Android and iOS projects to support TV.

After internal discussion, we intend to support that with this plugin, which will allow faster iteration than if these features are implemented within the CLI or elsewhere in the Expo monorepo.

How

The plugin has an isTV setting, that can be enabled either with the environment (EXPO_TV) or an optional plugin parameter isTV.

When isTV is true, the iOS Podfile, Xcode project, and splash screen storyboard are modified to support TV.

When isTV is false, the plugin sees if the above TV modifications have been made, and reverts them.

The plugin requires (but does not check) that the React Native TV repo be used in place of the normal React Native dependency:

{
  "dependencies": {
    "react-native": "npm:react-native-tvos@^0.72.4-0"
  }
}

If this is not the case, the plugin will run successfully, but Cocoapods installation will fail, since the React Native core repo does not support Apple TV.

Test Plan

douglowder commented 1 year ago

ENG-10042

douglowder commented 1 year ago

Test app to try this plugin out: https://github.com/douglowder/TestConfigPluginTV