tvOS is the operating system for Apple TV.

Posts under tvOS tag

111 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Xcode 13.0 can't pair to Apple TV 4K (tvOS 15.0)
On Xcode 13.0, I can no longer pair with an Apple TV 4K (tvOS 15.0). Until now it has always worked but since the new update to tvOS 15.0 and Xcode 13.0 I can no longer connect. I have gone through the following steps to connect: Open remote app and devices settings on Apple TV 4K (tvOS 15.0). Open Devices and Simulators in Xcode 13.0. Select Apple TV in the list and press "Pair". Code appears on the Apple TV and I can enter it in an Xcode window. After the code input, there is a short loading sign that a connection is being established. After a few seconds, the whole thing stops without an error message and the "Pair" button is visible again. Does anyone have the same problem? I would like to optimize my apps for tvOS 15 and test them on a physical device.
24
1
21k
May ’24
tvOS: How to avoid fast-forwarding in AVPlayerViewController
Due to legal restrictions I need to prevent my app's users from skipping and fast-forwarding the content that is played by AVPlayerViewController. I use playerViewController(:willResumePlaybackAfterUserNavigatedFrom:to:) and playerViewController(:timeToSeekAfterUserNavigatedFrom:to:) delegate methods to control the skipping behaviour. However, those delegate methods are only triggered for skip +/- 10, but not for fast-forwarding/rewinding.  Is there a way to prevent fast-forwarding in addition to skipping in AVPlayerViewController? Here is an example of the code I use: class ViewController: UIViewController {   override func viewDidAppear(_ animated: Bool) {     super.viewDidAppear(animated)     setUpPlayerViewController()   }   private func setUpPlayerViewController() {     let playerViewController = AVPlayerViewController()     playerViewController.delegate = self guard let url = URL(string: "https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8") else {       debugPrint("URL is not found")       return     }     let playerItem = AVPlayerItem(url: url)     let player = AVPlayer(playerItem: playerItem)     playerViewController.player = player     present(playerViewController, animated: true) {       playerViewController.player?.play()     }   } } extension ViewController: AVPlayerViewControllerDelegate {   public func playerViewController(_ playerViewController: AVPlayerViewController, willResumePlaybackAfterUserNavigatedFrom oldTime: CMTime, to targetTime: CMTime) { // Triggered on skip +/- 10, but not on fast-forwarding/rewinding     print("playerViewController(_:willResumePlaybackAfterUserNavigatedFrom:to:)")   }   public func playerViewController(_ playerViewController: AVPlayerViewController, timeToSeekAfterUserNavigatedFrom oldTime: CMTime, to targetTime: CMTime) -> CMTime {     // Triggered on skip +/- 10, but not on fast-forwarding/rewinding     print("playerViewController(_:timeToSeekAfterUserNavigatedFrom:to:)")     return targetTime   } }
2
1
1.2k
Sep ’23
Settings.bundle in tvOS 15.0 seems to no longer work.
I have an App that builds for iOS, iPadOS, macOS and Apple TV, which was last released to all the App Stores in April. Preferences/settings are handled by the App itself except for the Apple TV variant, where I use a Settings bundle. This worked fine until tvOS 15.0, where it appears that tvOS is not updating the value of the App’s settings from NSUserDefaults when the Settings App opens. I have been working on this problem off and on for the last week and am at wits end. I’ve searched WWDC videos looking for a clue, there must be some simple change I cannot see. I’ve made clean projects for iOS and tvOS, and using the identical OBJ-C code and Settings plist entries, the iOS version works perfectly, the tvOS version fails in the simulator and on the device. I am not trying to synchronize Settings across devices, just persist across restarts on a single device. My code stores data correctly in NSUserDefaults, it simply seems that tvOS Settings App is not reading values from there for display, nor writing changes that the user makes from Settings back to user defaults. None of the types in the test projects work: TexField, Switch, Title. The test code is so simple I hesitate to include it, but the code and the NSUserDefaults key identifiers do match. This code will preset my App’s version number for Settings to display in iOS 15 but not tvOS 15. It used to work in tvOS 14: <key>DefaultValue</key> <string>DefaultVersionValue</string> <key>Type</key> <string>PSTitleValueSpecifier</string> <key>Title</key> <string>Version</string> <key>Key</key> <string>VersionKey</string> </dict> ```   NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];    [ud registerDefaults:@{      @"TextFieldKey" : @"TextFieldValue",      @"VersionKey" : @"VersionValue"    }];        [ud setObject:@"3.14" forKey:@"VersionKey"]; Any idea? Many thanks.
4
0
897
May ’24
tvOS App Icon Errors
I made a minor change the UI of my tvOS App, and am now getting errors related to the App Icon. I have confirmed that all the background images DO match the requirements but App Store Connect won't let me upload: App Store Connect Operation Error Invalid Image Asset. The image stack 'App Icon' in 'Payload/My TV.app/Assets.car' has a background layer image that does not match the canvas dimensions '400x240'. App Store Connect Operation Error Invalid Image Asset. The image stack 'App Icon' in 'Payload/My TV.app/Assets.car' has a background layer image that does not match the canvas dimensions '800x480'. App Store Connect Operation Error Invalid Image Asset. The image stack 'App Icon' in 'Payload/My TV.app/Assets.car' has a background layer image that does not match the canvas dimensions '1280x768'. App Store Connect Operation Error Invalid Image Asset. The image stack 'App Icon' in 'Payload/My TV.app/Assets.car' has a background layer image that does not match the canvas dimensions '2560x1536'. App Store Connect Operation Error Invalid Image Asset. The App Store Icon must only contain an image with size (1280pt × 768pt @1x). Refer to https://developer.apple.com/tvos/human-interface-guidelines/icons-and-images/app-icon for more information Have the standards changed? Or is there another issue I should be looking at? Thanks!
2
0
1.4k
Mar ’24
Network Framework not picking WatchOS 9+
As you can see in this open source repository, I am trying to test out the code provided when you download the Apple sample "Building a custom peer-to-peer protocol" I bought a new Apple TV in order to work with this. But I have had so many issues! First I realized that the functionality is only available from WatchOS 9 or greater, but my Apple Watch 3 won't update to WatchOS 9. Then I got another watch, but it had to be updated. Then had to turn on the Developer Mode and then I was having a issues where it kept saying that the phone & watch needed to be unlocked, over and over -.-. Then finally after building the app on the watch from my computer using Xcode (latest), the problem I am now having is that the app on the AppleTV only detects the phones in the network, and not this new Apple Watch. -,- So now I just have a bunch of new technology that is doing nothing I have read through so many tutorials but can't tell why it doesn't detect it. It seems like the DDDevicePickerViewController is not returning the watch. The other question I have is, can I use the Network Framework to connect to multiple devices at the same time? (Think Texas hold em poker on Apple TV but with cards on each player's phone)
3
0
1.8k
Oct ’23
tvOS/SwiftUI: toolbar item steals focus
I'm trying to add a brand logo to a SwiftUI tvOS interface. The main UI is a TabView. Focus works fine until I try to add a ToolbarItem. Once I do that it seems to steal focus and my TabView becomes unusable. Here's a simple example that demonstrates the problem: struct TestView: View { var body: some View { NavigationView { TabView { Text("Screen One") .tabItem({ Text("One") }) Text("Screen Two") .tabItem({ Text("Two") }) Text("Screen Three") .tabItem({ Text("Three") }) } .toolbar { ToolbarItem(placement: .navigationBarLeading) { Image(systemName: "house.fill") } } } } } How can I keep focus from getting messed up? Should I not be using the toolbar to add the logo? It looks like just adding toolbar causes a UINavigationBar to be drawn on top of the tab bar, which is why it isn't getting focus. Still not sure how to fix it though...
2
0
1k
Sep ’23
Xcode 15.0 Beta: NEPacketTunnelProvider is only available in tvOS 17.0 or newer
I'm researching to develop a VPN application on tvOS 17.0, but even if I set the dev target version to 17.0, it still prompts me that the API is not available. 'NEPacketTunnelProvider' is only available in tvOS 17. 0 or newer I have 2 xcodes installed on my computer, I tried switching to sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer, but it still doesn't work. Is there anything else I need to set?
5
0
1.4k
Oct ’23
NEVPNProtocolIPSec unavailible on Apple TV?
I'm porting my VPN app to tvOS 17. Here's some code which works just fine in iOS but doesn't in tvOS 17: func toggleVPN() { let vpnManager = NEVPNManager.shared() vpnManager.loadFromPreferences { (error) in if let error = error { print("Could not load VPN Configurations: \(error.localizedDescription)") return } if vpnManager.connection.status == .connected || vpnManager.connection.status == .connecting { vpnManager.connection.stopVPNTunnel() } else { vpnManager.isEnabled = true vpnManager.isOnDemandEnabled = true vpnManager.localizedDescription = "tvpn" let p = NEVPNProtocolIPSec() p.authenticationMethod = .sharedSecret // or .certificate p.serverAddress = <REDACTED> p.username = "client" p.useExtendedAuthentication = true // Retrieve password and shared secret references from the keychain let secretData = <REDACTED>.data(using: .utf8)! let passData = <REDACTED>.data(using: .utf8)! p.sharedSecretReference = try! VPNKeychain.persistentReferenceFor(service: "vpn", account: "SharedSecret", password: secretData) // I took this part from Apple dev forums, it's tested in iOS p.passwordReference = try! VPNKeychain.persistentReferenceFor(service: "vpn", account: "Password", password: passData) vpnManager.protocolConfiguration = p vpnManager.saveToPreferences { (error) in if let error = error { print("Could not save VPN Configurations: \(error.localizedDescription)") return } do { try vpnManager.connection.startVPNTunnel() } catch { print("Could not start VPN Connection: \(error.localizedDescription)") } } } } } in iOS the VPN connects successfully, however in tvOS saveToPreferences returns error Code 1: Could not save VPN Configurations: Missing protocol or protocol has invalid type Another thing I noticed, that there's no com.apple.developer.networking.vpn.api entitlement for tvOS, but NEVPNManager is available there according to documentation. Could you advise what's the problem with my code?
3
0
823
Sep ’23
Unable to FaceTime in Apple TV A1842
Hi I have Apple TV 4K (5th gen) A1842. TVOS is 17 (21J5318f) and ios is 17 (21A5291h). I am not seeing any FaceTime icon on Apple TV. Any tips on how to FaceTime using an Apple TV? I am not a developer but a regular user who pays for developer license just to always have all betas. Seeking guidance as to what I may be doing wrong or not doing to not be able to FaceTime on Apple TV. regards ASB
1
0
1.8k
Sep ’23
Navigating Through tvOS UITableView By Skipping Through Letters
I have a UITableView that lists the files located in the app alphabetically. As there are over 1500 files, I'm trying to implement functionality to navigate by letter of the alphabet when the right button is clicked on the remote. The issue I'm having is that the TableView indeed moves to the right spot, but instead of being highlighted like it normally would, I get a lighter highlighted color, and clicking select does nothing. If I then navigate normally by pressing down, it moves it back up to the 2nd item in the list. ```- (void)viewDidLoad { [super viewDidLoad];`` // We're setting the stage! self.tableView.delegate = self; self.tableView.dataSource = self; self.definesPresentationContext = YES; self.currentIndex = 0; // Time to call the stars for a rehearsal. [self populateTheView]; // Let's make room for our magical focus director. self.dapperFocusGuide = [[UIFocusGuide alloc] init]; [self.view addLayoutGuide:self.dapperFocusGuide]; // Red carpet time! [self.dapperFocusGuide.topAnchor constraintEqualToAnchor:self.tableView.topAnchor].active = YES; [self.dapperFocusGuide.leftAnchor constraintEqualToAnchor:self.tableView.leftAnchor].active = YES; [self.dapperFocusGuide.widthAnchor constraintEqualToAnchor:self.tableView.widthAnchor].active = YES; [self.dapperFocusGuide.heightAnchor constraintEqualToAnchor:self.tableView.heightAnchor].active = YES; }- (void)populateTheView { NSBundle *bundle = [NSBundle mainBundle]; self.title = @"Devo Songs"; self.files = [bundle pathsForResourcesOfType:@"pdf" inDirectory:@"WorshipSongs"]; NSString *documentsDirectoryPath = [self.files objectAtIndex:self.currentIndex]; self.filenames = [[documentsDirectoryPath lastPathComponent] stringByDeletingPathExtension]; NSMutableArray *names = [NSMutableArray arrayWithCapacity:[self.files count]]; for (NSString *path in self.files) { [names addObject:[[path lastPathComponent] stringByDeletingPathExtension]]; } self.files = [names sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [self becomeFirstResponder]; // Initial spotlight position. self.dapperFocusGuide.preferredFocusEnvironments = @[self.tableView.visibleCells.firstObject]; } - (BOOL)canBecomeFirstResponder { return YES; } - (void)handleRightButtonPress { // Get the current name. NSString *currentName = self.files[self.currentIndex]; // Get the current letter. NSString *currentLetter = [currentName substringToIndex:1]; // Find the next index starting from the current index. NSInteger nextIndex = self.currentIndex + 1; while (nextIndex < self.files.count) { NSString *nextName = self.files[nextIndex]; NSString *nextLetter = [nextName substringToIndex:1]; if (![nextLetter isEqualToString:currentLetter]) { break; } nextIndex++; } // Check if we found a valid next index. if (nextIndex < self.files.count) { // Scroll the table view to the row corresponding to the next letter. [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:nextIndex inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO]; // Update the current index to the new index. self.currentIndex = nextIndex; // Deselect the current selected row (if any). NSIndexPath *previousSelectedIndexPath = [self.tableView indexPathForSelectedRow]; if (previousSelectedIndexPath) { [self.tableView deselectRowAtIndexPath:previousSelectedIndexPath animated:NO]; } // Select the cell at the specified index. NSIndexPath *indexPathToSelect = [NSIndexPath indexPathForRow:self.currentIndex inSection:0]; [self.tableView selectRowAtIndexPath:indexPathToSelect animated:NO scrollPosition:UITableViewScrollPositionNone]; UITableViewCell *cellToFocus = [self.tableView cellForRowAtIndexPath:indexPathToSelect]; self.dapperFocusGuide.preferredFocusEnvironments = @[cellToFocus]; } else { // If we have reached the end of the list, reset the index to the first element. self.currentIndex = 0; // Scroll back to the top of the table view. [self.tableView setContentOffset:CGPointZero animated:NO]; // Deselect the current selected row (if any). NSIndexPath *previousSelectedIndexPath = [self.tableView indexPathForSelectedRow]; if (previousSelectedIndexPath) { [self.tableView deselectRowAtIndexPath:previousSelectedIndexPath animated:NO]; } // Select the cell at the specified index. NSIndexPath *indexPathToSelect = [NSIndexPath indexPathForRow:self.currentIndex inSection:0]; [self.tableView selectRowAtIndexPath:indexPathToSelect animated:NO scrollPosition:UITableViewScrollPositionNone]; UITableViewCell *cellToFocus = [self.tableView cellForRowAtIndexPath:indexPathToSelect]; self.dapperFocusGuide.preferredFocusEnvironments = @[cellToFocus]; } }
1
0
494
Aug ’23
AppleTV only passes through StereoPCM (TVs 17)
My AppleTV (4K, latest version) only passes through a PCM Stereo audio signal to my soundbar instead of a Dolby 5.1 on shows that say they are 5.1. Oddly, Dolby Atmos works fine. I've tried various settings on the AppleTV and my SamsungTV, but I can't get anything but a Stereo PCM audio on non-atmos content. Note: I am using the Beta TVs 17, so I'm thinking it could be a glitch in the new software.
1
0
696
Aug ’23
Using a real Siri Remote with tvOS simulator
Hi, In this article here: https://developer.apple.com/documentation/xcode/interacting-with-your-app-in-the-tvos-simulator#Navigate-using-a-physical-remote-control ...it gives steps on how to pair the Siri Remote so that it works with the simulator. However, when I follow the steps, the remote shows up in the Bluetooth list as a "generic device" only labelled by its serial number, and it definitely can't control the simulator. Just me?
0
0
518
Aug ’23
TVML Player JS start playing delay content behind the current LIVE timestamp
Hi all ! I have been working a while on this problem . Turns out some of our customers when playing LIVE HLS content through a TVML Application using the standard Player JS API , for some channels the content start playing 5 mins before live timestamp witch is an unexpected behavior using this Player API. As a developer , i took the channels customer content and implement 2 Sample tvOS Apps : By using Fairplay + AVPlayerController , all native implementation and the issue is not reproducible . By using FairPlay + Player JS API , a TVML Sample implementation and the issue i always reproducible. **For the folks of Apple Developer Technical Support (DTS) : ** Case ID : 3280424 Apple Feedback link : https://feedbackassistant.apple.com/feedback/12565232 Anyone else seeing this issue?
0
0
605
Aug ’23
tvOS keyboard crash when I use emailAddress as content type
Hi there, Currently I've been trying to fix a crash when a textfield (with emailAdress as content type) displays a list of recent emails used. The issue can be reproduced with a new project. Steps to reproduce: Click on textfield. A list of recent emails used will be displayed. Chose any email. List will be hidden automatically. If you click play/pause from physical remote control the crash appears with the following report: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 9223372036854775807 beyond bounds [0 .. 4]' terminating due to uncaught exception of type NSException CoreSimulator 885.2 - Device: Apple TV 4K (3rd generation) (at 1080p) (1C111442-8AE4-40C7-B782-1CD459382A6F) - Runtime: tvOS 16.4 (20L494) - DeviceType: Apple TV 4K (3rd generation) (at 1080p) Does anyone knows how to fix that issue? I realized that this issue can't be reproduced when you choose Enter New instead of choose any recent email.
0
0
398
Aug ’23