Skip to content

Commit

Permalink
[expo-av][iOS] Fix compilation on tvOS (#24864)
Browse files Browse the repository at this point in the history
# Why

Allow the `expo-av` module to compile on Apple TV.

# How

To safely do this without heavy modification of `EXAV.m`, the podspec is
modified so that tvOS uses a separate module implementation `EXAVTV.m`,
with the audio recording code removed and stub module methods for those
features.

# Test Plan

- Tested on a test app with Expo 50 alpha packages and the TV plugin
- CI should continue to pass

# Checklist

- [x] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [x] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [x] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
  • Loading branch information
douglowder authored and marklawlor committed Oct 30, 2023
1 parent 1cf3627 commit a0f0440
Show file tree
Hide file tree
Showing 4 changed files with 763 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/expo-av/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
### 🐛 Bug fixes

- Update pitch algorithm settings for iOS >= 17. ([#24678](https://github.com/expo/expo/pull/24678) by [@hromovp](https://github.com/hromovp))
- [iOS] fix compilation on tvOS. ([#24864](https://github.com/expo/expo/pull/24864) by [@douglowder](https://github.com/douglowder))

### 💡 Others

Expand Down
5 changes: 4 additions & 1 deletion packages/expo-av/ios/EXAV.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.license = package['license']
s.author = package['author']
s.homepage = package['homepage']
s.platform = :ios, '13.0'
s.platforms = { :ios => '13.0', :tvos => '13.0' }
s.source = { git: 'https://github.com/expo/expo.git' }
s.static_framework = true

Expand All @@ -28,5 +28,8 @@ Pod::Spec.new do |s|
s.vendored_frameworks = "#{s.name}.xcframework"
else
s.source_files = "#{s.name}/**/*.{h,m,mm,swift}"
s.tvos.exclude_files = "#{s.name}/**/EXAudioRecordingPermissionRequester.{h,m}",
"#{s.name}/**/EXAV.m"
s.ios.exclude_files = "#{s.name}/**/EXAVTV.m"
end
end
Loading

0 comments on commit a0f0440

Please sign in to comment.