marcshilling / react-native-idle-timer

A cross-platform bridge that allows you to enable and disable the screen idle timer in your React Native app
MIT License
212 stars 41 forks source link

tvOS Support. #36

Closed rkz98 closed 4 months ago

rkz98 commented 5 months ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-idle-timer@2.2.2 for the project I'm working on.

I've fixed the .podspec file, to support tvOS (https://github.com/react-native-tvos/react-native-tvos), by setting min-version to 9.0 (which is recommended here: https://developer.apple.com/documentation/uikit/uiapplication/1623070-idletimerdisabled)

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-idle-timer/react-native-idle-timer.podspec b/node_modules/react-native-idle-timer/react-native-idle-timer.podspec
index e4e541a..d0ca646 100644
--- a/node_modules/react-native-idle-timer/react-native-idle-timer.podspec
+++ b/node_modules/react-native-idle-timer/react-native-idle-timer.podspec
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
   s.source         = { :git => 'https://github.com/marcshilling/react-native-idle-timer.git', :tag => s.version }

   s.requires_arc   = true
-  s.platform       = :ios, '7.0'
+  s.platforms      = { ios: '7.0', tvos: '9.0' }

   s.preserve_paths = 'README.md', 'package.json', 'index.js'
   s.source_files   = 'ios/RNIdleTimer/*.{h,m}'

This issue body was partially generated by patch-package.

marcshilling commented 4 months ago

Thank you for this! Merged via #37 and published in v2.2.3