So recently I migrated the topshelf extension for my app from the deprecated TVServiceProvider to the new TVContentProvider in 13.0 and onwards.
I finally got it working (not helped by wasting hours figuring out that the NSExtensionPrincipalClass has to be the first thing listed in the NSExtension dictionary in the Info.plist or the extension just terminates, I kid you not!) but there is one last thing that I can't figure out.
What works:
1. remove any instance of my application from the Apple TV
2. install and launch my app from xcode on the Apple TV
3. when i back out of the app, the topshelf code is working, it calls the loadTopShelfContentWithCompletionHandler function and I am able to give it what it wants and it gets displayed correctly
Problem is, if I terminate the application from Xcode, I can no longer get the topshelf to work when I try and launch it again from Xcode. It is not listed as running (as a process to attach to, for example). The app runs fine, but there is no extension process launched alongside it.
I can get it working again in one of two ways; either A) reboot the Apple TV, in which case I find tvOS launches the extension a few seconds after boot without me doing anything (not even highlighting my app), or, B) following the steps above if I delete the instance from the Apple TV and install it again using Xcode.
Essentially, it behaves as if the top shelf extension is launched once, and only once, on bootup of the Apple TV, or on first install. It appears to get terminated when I launch the app again using xcode (e.g. with a new build or something, or even running the same build) and only A) or B) above can get it running again.
Has anyone else seen this?