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

Cannot read property 'setIdleTimerDisabled' of undefined on tvOS #5

Closed abcd-ca closed 7 years ago

abcd-ca commented 7 years ago

Hi @marcshilling, I got your library to work on iOS but I wonder if you have any suggestions for getting it to work on tvOS? I am getting, "Unhandled JS Exception: Cannot read property 'setIdleTimerDisabled' of undefined". I've tried adding the project to my project, manually. I've added the (tvOS compiled) .a to my linked libraries. In that view, if I right click the .a and Show in Finder, it does show me the file in the finder. Any ideas of what else I might be missing? Here's the commit I made. If we can get it working I'll issue a pull request: https://github.com/abcd-ca/react-native-idle-timer/commit/677541b9cd5a65f61c5333e713dd50a949221c31 Thanks!

abcd-ca commented 7 years ago

follow-up: It's something to do with the project configuration 'cause when I just copy the .h and .m into my project, the source code works as is

marcshilling commented 7 years ago

That error means you haven't linked the native library correctly. I'd recommend starting from scratch and following the README instructions again. Hard to tell without me looking at your project structure.