Search code examples
javascripttvosapple-tvtvml

Use external javascript libraries for TVML based Apple TV apps?


Is it possible to load and use external javascript libraries for use on TVML Apple TV apps?

For example, can I load the Firebase js library and use it to fetch data? Or load lodash to use it's functions?


Solution

  • You can load external JavaScript libraries using the evaluateScript function.

    evaluateScripts([“ARRAY OF JS URLS”], function(success) {
    
    // do work here once the JavaScript files have been evaluated
    
    })