Jeff Bowen
Jeff Bowen

Reputation: 6162

Can I detect when an Apple TV app becomes active again from TVJS?

I need to take an action whenever my TVML/TVJS Apple TV app becomes active again after having already been launched. It seems the onLaunch app lifecycle event is only called when my app is launched from scratch. Is this possible using TVJS or do I have to use evaluateInJavaScriptContext in the applicationDidBecomeActive method in my AppDelegate?

Upvotes: 1

Views: 385

Answers (1)

Jeff Bowen
Jeff Bowen

Reputation: 6162

It's currently undocumented but the App.onResume property seems to work in tvOS beta 3.

App.onResume = function (options) {
  console.log("App resumed.");
  console.log(options);
};

Upvotes: 2

Related Questions