diff --git a/.gitignore b/.gitignore index 9b61ac79..2d18b882 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,6 @@ lib/ # generated API documentation docs/generated + +# developer specific configuration file +example/ios/Developer.xcconfig diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 56359517..206c2302 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,6 +45,14 @@ To edit the Swift/Objective-C files, open `example/ios/BitmovinPlayerReactNative To edit the Kotlin files, open `example/android` in Android Studio and find the source files at `bitmovin-player-react-native` under `Android`. +## For iOS/tvOS on-device development + +To build the example project for an iOS or tvOS device, you need to create a file at `example/ios/Developer.xcconfig`. In this file, add your development team like this: + +```yml +DEVELOPMENT_TEAM = YOUR_TEAM_ID +``` + ## TypeScript Code Style - Follow the `eslint` rules (`yarn lint`). They are enforced automatically via a pre-commit git hook. diff --git a/example/ios/BitmovinPlayerReactNativeExample-tvOS/Debug.xcconfig b/example/ios/BitmovinPlayerReactNativeExample-tvOS/Debug.xcconfig new file mode 100644 index 00000000..e65f91b3 --- /dev/null +++ b/example/ios/BitmovinPlayerReactNativeExample-tvOS/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-BitmovinPlayerReactNativeExample-tvOS/Pods-BitmovinPlayerReactNativeExample-tvOS.debug.xcconfig" +#include? "Developer.xcconfig" diff --git a/example/ios/BitmovinPlayerReactNativeExample-tvOS/Release.xcconfig b/example/ios/BitmovinPlayerReactNativeExample-tvOS/Release.xcconfig new file mode 100644 index 00000000..e1687e69 --- /dev/null +++ b/example/ios/BitmovinPlayerReactNativeExample-tvOS/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-BitmovinPlayerReactNativeExample-tvOS/Pods-BitmovinPlayerReactNativeExample-tvOS.release.xcconfig" +#include? "Developer.xcconfig" diff --git a/example/ios/BitmovinPlayerReactNativeExample.xcodeproj/project.pbxproj b/example/ios/BitmovinPlayerReactNativeExample.xcodeproj/project.pbxproj index 8b7e58c1..131a67b7 100644 --- a/example/ios/BitmovinPlayerReactNativeExample.xcodeproj/project.pbxproj +++ b/example/ios/BitmovinPlayerReactNativeExample.xcodeproj/project.pbxproj @@ -17,6 +17,10 @@ 4CE3830528BFD270002DDF82 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4CE3830428BFD270002DDF82 /* AppDelegate.mm */; }; 5915995436EFADAE00A71930 /* libPods-BitmovinPlayerReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 06D60B6FD8A3297CA32930A9 /* libPods-BitmovinPlayerReactNativeExample.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + A8DB69432B31B5DB00BAD718 /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A8DB69412B31B5DB00BAD718 /* Debug.xcconfig */; }; + A8DB69442B31B5DB00BAD718 /* Release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A8DB69422B31B5DB00BAD718 /* Release.xcconfig */; }; + A8DB69472B31B61400BAD718 /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A8DB69452B31B61400BAD718 /* Debug.xcconfig */; }; + A8DB69482B31B61400BAD718 /* Release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = A8DB69462B31B61400BAD718 /* Release.xcconfig */; }; B3861322686908F1A14AEDFF /* libPods-BitmovinPlayerReactNativeExample-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B0574780FC6EB7D0D35EDF5 /* libPods-BitmovinPlayerReactNativeExample-tvOS.a */; }; /* End PBXBuildFile section */ @@ -40,6 +44,10 @@ 7B0574780FC6EB7D0D35EDF5 /* libPods-BitmovinPlayerReactNativeExample-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-BitmovinPlayerReactNativeExample-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 7D2D062A80C63508C52FD003 /* Pods-BitmovinPlayerReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BitmovinPlayerReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-BitmovinPlayerReactNativeExample/Pods-BitmovinPlayerReactNativeExample.debug.xcconfig"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = BitmovinPlayerReactNativeExample/LaunchScreen.storyboard; sourceTree = ""; }; + A8DB69412B31B5DB00BAD718 /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = BitmovinPlayerReactNativeExample/Debug.xcconfig; sourceTree = ""; }; + A8DB69422B31B5DB00BAD718 /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = BitmovinPlayerReactNativeExample/Release.xcconfig; sourceTree = ""; }; + A8DB69452B31B61400BAD718 /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + A8DB69462B31B61400BAD718 /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; BDAFF5A7A0416D4C35F3B620 /* Pods-BitmovinPlayerReactNativeExample-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BitmovinPlayerReactNativeExample-tvOS.debug.xcconfig"; path = "Target Support Files/Pods-BitmovinPlayerReactNativeExample-tvOS/Pods-BitmovinPlayerReactNativeExample-tvOS.debug.xcconfig"; sourceTree = ""; }; CAA1356D0B7800248D07E196 /* Pods-BitmovinPlayerReactNativeExample-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BitmovinPlayerReactNativeExample-tvOS.release.xcconfig"; path = "Target Support Files/Pods-BitmovinPlayerReactNativeExample-tvOS/Pods-BitmovinPlayerReactNativeExample-tvOS.release.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; @@ -76,6 +84,8 @@ 13B07FB61A68108700A75B9A /* Info.plist */, 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 13B07FB71A68108700A75B9A /* main.m */, + A8DB69412B31B5DB00BAD718 /* Debug.xcconfig */, + A8DB69422B31B5DB00BAD718 /* Release.xcconfig */, ); name = BitmovinPlayerReactNativeExample; sourceTree = ""; @@ -100,6 +110,8 @@ 4CE382FE28BFD10E002DDF82 /* main.m */, 4CE3830328BFD1E2002DDF82 /* AppDelegate.h */, 4CE3830428BFD270002DDF82 /* AppDelegate.mm */, + A8DB69452B31B61400BAD718 /* Debug.xcconfig */, + A8DB69462B31B61400BAD718 /* Release.xcconfig */, ); path = "BitmovinPlayerReactNativeExample-tvOS"; sourceTree = ""; @@ -115,18 +127,10 @@ path = Pods; sourceTree = ""; }; - 832341AE1AAA6A7D00B99B32 /* Libraries */ = { - isa = PBXGroup; - children = ( - ); - name = Libraries; - sourceTree = ""; - }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( 13B07FAE1A68108700A75B9A /* BitmovinPlayerReactNativeExample */, - 832341AE1AAA6A7D00B99B32 /* Libraries */, 4CE382EF28BFD10C002DDF82 /* BitmovinPlayerReactNativeExample-tvOS */, 83CBBA001A601CBA00E9B192 /* Products */, 2D16E6871FA4F8E400B85C8A /* Frameworks */, @@ -239,8 +243,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A8DB69442B31B5DB00BAD718 /* Release.xcconfig in Resources */, 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, + A8DB69432B31B5DB00BAD718 /* Debug.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -248,8 +254,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A8DB69482B31B61400BAD718 /* Release.xcconfig in Resources */, 4CE382FD28BFD10E002DDF82 /* LaunchScreen.storyboard in Resources */, 4CE382FA28BFD10E002DDF82 /* Assets.xcassets in Resources */, + A8DB69472B31B61400BAD718 /* Debug.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -564,7 +572,7 @@ /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7D2D062A80C63508C52FD003 /* Pods-BitmovinPlayerReactNativeExample.debug.xcconfig */; + baseConfigurationReference = A8DB69412B31B5DB00BAD718 /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++17"; @@ -572,7 +580,6 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; ENABLE_BITCODE = NO; INFOPLIST_FILE = BitmovinPlayerReactNativeExample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; @@ -593,7 +600,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4451A76D9ED45CF044433360 /* Pods-BitmovinPlayerReactNativeExample.release.xcconfig */; + baseConfigurationReference = A8DB69422B31B5DB00BAD718 /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_CXX_LANGUAGE_STANDARD = "c++17"; @@ -601,7 +608,6 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = BitmovinPlayerReactNativeExample/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -620,7 +626,7 @@ }; 4CE3830028BFD10E002DDF82 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = BDAFF5A7A0416D4C35F3B620 /* Pods-BitmovinPlayerReactNativeExample-tvOS.debug.xcconfig */; + baseConfigurationReference = A8DB69452B31B61400BAD718 /* Debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -633,7 +639,6 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "BitmovinPlayerReactNativeExample-tvOS/Info.plist"; @@ -658,7 +663,7 @@ }; 4CE3830128BFD10E002DDF82 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = CAA1356D0B7800248D07E196 /* Pods-BitmovinPlayerReactNativeExample-tvOS.release.xcconfig */; + baseConfigurationReference = A8DB69462B31B61400BAD718 /* Release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; @@ -672,7 +677,6 @@ CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; GCC_C_LANGUAGE_STANDARD = gnu11; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "BitmovinPlayerReactNativeExample-tvOS/Info.plist"; diff --git a/example/ios/BitmovinPlayerReactNativeExample/Debug.xcconfig b/example/ios/BitmovinPlayerReactNativeExample/Debug.xcconfig new file mode 100644 index 00000000..1438a4d6 --- /dev/null +++ b/example/ios/BitmovinPlayerReactNativeExample/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-BitmovinPlayerReactNativeExample/Pods-BitmovinPlayerReactNativeExample.debug.xcconfig" +#include? "Developer.xcconfig" diff --git a/example/ios/BitmovinPlayerReactNativeExample/Release.xcconfig b/example/ios/BitmovinPlayerReactNativeExample/Release.xcconfig new file mode 100644 index 00000000..f32ea81c --- /dev/null +++ b/example/ios/BitmovinPlayerReactNativeExample/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-BitmovinPlayerReactNativeExample/Pods-BitmovinPlayerReactNativeExample.release.xcconfig" +#include? "Developer.xcconfig" diff --git a/example/ios/Podfile b/example/ios/Podfile index 91eb4a8e..ce6036e4 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -70,8 +70,10 @@ post_install do |installer| __apply_Xcode_12_5_M1_post_install_workaround(installer) fix_simulator_run(installer) fix_deployment_target(installer) + disable_resource_bundle_signing(installer) end +# Workaround for running on simulator on Apple Silicon from the command-line def fix_simulator_run(installer) installer.pods_project.targets.each do |target| target.build_configurations.each do |config| @@ -81,6 +83,7 @@ def fix_simulator_run(installer) end end +# Align deployment target of all targets in the Pods project with the main project def fix_deployment_target(installer) return if !installer project = installer.pods_project @@ -105,3 +108,15 @@ def fix_deployment_target(installer) end end end + +# Workaround against required code-signing for resource bundle targets +def disable_resource_bundle_signing(installer) + installer.pods_project.targets.each do |target| + target_is_resource_bundle = target.respond_to?(:product_type) && target.product_type == 'com.apple.product-type.bundle' + target.build_configurations.each do |config| + if target_is_resource_bundle + config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO' + end + end + end +end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index c1bf32f8..49d277a8 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -751,6 +751,6 @@ SPEC CHECKSUMS: Yoga: f67f5769ce78049c5fe798bc735f04535c7bc1ac YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 72e333b84551f3cbf0fe463cce703cb47a7372a6 +PODFILE CHECKSUM: 531b9f7c2ff19d5c33a14e9a441a3d3d22007a25 COCOAPODS: 1.14.2 diff --git a/integration_test/ios/Podfile b/integration_test/ios/Podfile index 484273c8..639b6b6e 100644 --- a/integration_test/ios/Podfile +++ b/integration_test/ios/Podfile @@ -67,6 +67,7 @@ post_install do |installer| fix_simulator_run(installer) end +# Align deployment target of all targets in the Pods project with the main project def fix_deployment_target(installer) return if !installer project = installer.pods_project @@ -92,6 +93,7 @@ def fix_deployment_target(installer) end end +# Workaround for running on simulator on Apple Silicon from the command-line def fix_simulator_run(installer) installer.pods_project.targets.each do |target| target.build_configurations.each do |config|