tvOS is the operating system for Apple TV.

tvOS Documentation

Posts under tvOS tag

124 Posts
Sort by:
Post marked as solved
22 Replies
20k Views
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.
Posted
by janapple.
Last updated
.
Post not yet marked as solved
1 Replies
701 Views
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.
Posted Last updated
.
Post not yet marked as solved
1 Replies
82 Views
Hey, I have an app that presents a UIWindow on top of an existing window. I've made all the needed calls to makeKeyAndVisible() and I can clearly see the new window with the subviews on the screen. I've made the subview receive focus by implementing them as custom views that have canBecomeFocused as true also the window implements preferredFocusEnvironments and returns these subviews The issue the focus engine doesn't want to move to the bottom view, it seems the first one does get focus. The error I'm seeing when printing using UIFocusDebugger.checkFocusability(): <UIFocusUpdateContext: 0x600003318000: previouslyFocusedItem=<FV: 0x102a17f30>, nextFocusedItem=(null), focusHeading=Down> The following issues were found that would prevent this item from being focusable: - ISSUE: This item is not visible onscreen. I can't find any reference online about this error, so it seems something really wild is going on and I can't find the reason. Did anyone encounter this before or knows when this error is being printed? What causes the focus engine to think the view is not visible when it's all there?
Posted
by simonb_tp.
Last updated
.
Post not yet marked as solved
0 Replies
57 Views
I'm developing an Apple TV OS app using SwiftUI. I'm encountering an issue with the color of the tab item. I want the color of the tab item to turn green when focused; for instance, when the tab item is selected, its background color should be green. Below is my current code, but it's not working. I've tried several other approaches, but none have worked. struct ContentView: View { @State private var selectedTab = 0 var body: some View { ZStack(alignment: .topLeading){ TabView(selection: $selectedTab) { HomeView() .tabItem { AppColors.gradientColor1 Label("Home", image: "home-dash") } .tag(0) ProductsView() .tabItem { Label("Products", image: "open box-search") } .tag(1) SearchView() .tabItem { Label("Search", image: "search") } .tag(2) } .accentColor(Color.green) .background(.black) Image("amazontabbarlogo") } } }
Posted
by Rajatalha.
Last updated
.
Post not yet marked as solved
0 Replies
99 Views
I am guessing this is a NavigationSplitView and the menu is in the sidebar closure. But I'm not quite sure how to reproduce this style of menu. Along with the collapsing breadcrumb for back button. I would have thought this would be out of the box?
Posted Last updated
.
Post marked as solved
1 Replies
147 Views
I have a two-view app where the main view is a procedural animation and a secondary view controls settings for the animation. I want to use Play/Pause to toggle between the views, but can't figure out how to do this. Ideally the main view does not have any visible control and the whole screen can be dedicated to the animation view. Attaching onPlayPauseCommand to the main view does not work. I've also tried managing focus using onFocus without success. I'm open to other ways to toggle between the main and settings views, it's just that Play/Pause seems the most intuitive.
Posted Last updated
.
Post not yet marked as solved
0 Replies
144 Views
Conformed with a couple buddies who also made the mistake of "upgrading" - audio but no video with the 16.x TV emus, no play with the 17.x emus. When is the fix?
Posted
by pcnweb.
Last updated
.
Post marked as solved
1 Replies
348 Views
I know that this is not a coding question and I have posted on the regular Apple Forum and have been working with the 800 Tech Support folk for 4 months. I am in a world of hurt. Have ATV + Samsung TV + external soundbar. All software versions are current NO Cable box (direct input). 4 months ago I had Cable box = zero problems. With Samsung on and ATV off, stereo = Dolby 5.1 sounds great. With ATV also on, no stereo. I can use Siri remote to activate stereo until I change to a new movie. ATV then reverts to mono = PCM One Tech Support lady said to just not watch multiple movie. ?$@!*+^? I have spoken with engineers at Samsung and Sonos (soundbar). Both say my cabling is correct = 1 cable from soundbar to HDMI Arc on TV + 1 cable from ATV to another HDMI port on TV. Another Tech Support folk said to connect ATV to soundbar. Soundbars don’t have gobs of HDMI ports, the TV does. ?!$@*^+%# I have spoken with Apple Tech Support with zero help for 3-4 months. I think I have been a good soldier. But it is time for real results. Please help
Posted
by JohnLove.
Last updated
.
Post not yet marked as solved
0 Replies
196 Views
Hello, on tvOS/Apple TV using Swift or Objective-C, is-it possible to get the key pressed by the HDMI-CEC remote controller of the TV (not the Siri remote controller) ? Thanks
Posted
by pol2095.
Last updated
.
Post not yet marked as solved
0 Replies
224 Views
My app is currently on the app store for IOS, iPadOS and MacOS. I have created a version for Apple TV but cannot get it to save to iCloud. Is there anyone who can help me get my app to save to iCloud for the Apple TV?
Posted Last updated
.
Post not yet marked as solved
0 Replies
308 Views
I'm attempting to integrate DRM into the app. I've developed a prototype, but the delegate method shouldWaitForLoadingOfRequestedResource isn't being triggered on certain devices, although it functions correctly on others. Notably, it's invoked on Apple TV 4K (3rd generation) Wi-Fi (A2737) but not on Apple TV HD (A1625). Are there any specific configurations needed to ensure this method is invoked? let url = URL(string: RESOURCE_URL)! // Create the asset instance and the resource loader because we will be asked // for the license to playback DRM protected asset. let asset = AVURLAsset(url: url) let queue = DispatchQueue(label: CUSTOM_SERIAL_QUEUE_LABEL) asset.resourceLoader.setDelegate(self, queue: queue) // Create the player item and the player to play it back in. let playerItem = AVPlayerItem(asset: asset) let player = AVPlayer(playerItem: playerItem) // Create a new AVPlayerViewController and pass it a reference to the player. let controller = AVPlayerViewController() controller.player = player // Modally present the player and call the player's play() method when complete. present(controller, animated: true) { player.play() } } //Please note if your delegate method is not being called then you need to run on a REAL DEVICE func resourceLoader(_ resourceLoader: AVAssetResourceLoader, shouldWaitForLoadingOfRequestedResource loadingRequest: AVAssetResourceLoadingRequest) -> Bool { // Getting data for KSM server. Get the URL from tha manifest, we wil need it later as it // contains the assetId required for the license request. guard let url = loadingRequest.request.url else { print(#function, "Unable to read URL from loadingRequest") loadingRequest.finishLoading(with: NSError(domain: "", code: -1, userInfo: nil)) return false } // Link to your certificate on BuyDRM's side. // Use the commented section if you want to refer the certificate from your bundle i.e. Store Locally /* guard let certificateURL = Bundle.main.url(forResource: "certificate", withExtension: "der"), let certificateData = try? Data(contentsOf: certificateURL) else { print("failed...", #function, "Unable to read the certificate data.") loadingRequest.finishLoading(with: NSError(domain: "com.domain.error", code: -2, userInfo: nil)) return false } */ guard let certificateData = try? Data(contentsOf: URL(string: CERTIFICATE_URL)!) else { print(#function, "Unable to read the certificate data.") loadingRequest.finishLoading(with: NSError(domain: "", code: -2, userInfo: nil)) return false } // The assetId from the main/variant manifest - skd://***, the *** part. Get the SPC based on the // already collected data i.e. certificate and the assetId guard let contentId = url.host, let contentIdData = contentId.data(using: String.Encoding.utf8) else { loadingRequest.finishLoading(with: NSError(domain: "", code: -3, userInfo: nil)) print(#function, "Unable to read the SPC data.") return false } guard let spcData = try? loadingRequest.streamingContentKeyRequestData(forApp: certificateData, contentIdentifier: contentIdData, options: nil) else { loadingRequest.finishLoading(with: NSError(domain: "", code: -3, userInfo: nil)) print(#function, "Unable to read the SPC data.") return false } // Prepare to get the license i.e. CKC. let requestUrl = CKC_URL let stringBody = "spc=\(spcData.base64EncodedString())&assetId=\(contentId)" let postData = NSData(data: stringBody.data(using: String.Encoding.utf8)!) // Make the POST request with customdata set to the authentication XML. var request = URLRequest(url: URL(string: requestUrl)!) request.httpMethod = "POST" request.httpBody = postData as Data request.allHTTPHeaderFields = ["customdata" : ACCESS_TOKEN] let configuration = URLSessionConfiguration.default let session = URLSession(configuration: configuration) let task = session.dataTask(with: request) { data, response, error in if let data = data { // The response from the KeyOS MultiKey License server may be an error inside JSON. do { let parsedData = try JSONSerialization.jsonObject(with: data) as! [String:Any] let errorId = parsedData["errorid"] as! String let errorMsg = parsedData["errormsg"] as! String print(#function, "License request failed with an error: \(errorMsg) [\(errorId)]") } catch let error as NSError { print(#function, "The response may be a license. Moving on.", error) } // The response from the KeyOS MultiKey License server is Base64 encoded. let dataRequest = loadingRequest.dataRequest! // This command sends the CKC to the player. dataRequest.respond(with: Data(base64Encoded: data)!) loadingRequest.finishLoading() } else { print(#function, error?.localizedDescription ?? "Error during CKC request.") } } task.resume() // Tell the AVPlayer instance to wait. We are working on getting what it wants. return true }
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.2k Views
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!
Posted Last updated
.
Post not yet marked as solved
0 Replies
248 Views
Hello, I am new to Apple TV Development. I am researching if it would be possible to develop a tvOS App for IPTV that consumes content entirely from an API in the local network (I have domain such as sampleserver.com that points to a local network IP such as 192.168.1.10 ) and also plays back m3u8 HLS sources (live and VOD) produced in that local network server. No content comes from the cloud. Here are my questions: Would Apple approve this kind of app in the App Store? Or will Apple ask me to instead deploy this as a "Custom App" with Apple Business Manager and an MDM server? Is there an App Builder technology that fits better for this use case, such as TVML? If this app is published in the App Store and a user that is not in that local network, is there a guideline from Apple that I should follow to let the user know that he does not have access to the local content?
Posted
by jienco.
Last updated
.
Post not yet marked as solved
0 Replies
239 Views
Invalid Image Asset. The image stack 'App Icon' in 'Payload/VBIC.app/Assets.car' has a background layer image that does not match the canvas dimensions '800x480'. (ID: 9984fc86-f4b8-4968-9640-c368bd988a9b) PLATFORM AND VERSION tvOS Xcode Version 15.3 (15E204a) We verified several times and recreated all images. Error persists and is repeatable.
Posted Last updated
.
Post not yet marked as solved
0 Replies
280 Views
We have built the game on Unreal engine 4 and we have optimised the game to run on tvOS devices newer than 2017 (viz. Apple TV 4k and above). We could not bring it down to support Apple TV HD (2015) due to its visual and memory requirements. Is there a way to exclude Apple TV HD from support list. We couldnt find any required device capability to add to info.plist (eg: iphone-ipad-minimum-performance-a12, we tried it but this does not work for tvOS build).
Posted Last updated
.
Post not yet marked as solved
1 Replies
421 Views
I'm trying to do something so seemingly basic, yet I can't get it to work and I'm flummoxed. In a basic, vanilla SwiftUI app for tvOS, embed a single Text element with a very long string (hundreds of lines) in it: struct ContentView: View { var body: some View { ScrollView(.vertical) { Text(veryLargeString) .focusable() } } } Then fire up the app on tvOS, and it will not scroll. No matter what I do. Pressing arrow keys, swiping fast with my thumb, and nothing. It will not move. Ironically, in the Xcode SwiftUI Preview window—it does scroll, so that's always a fun tease. What I do know is that the focus engine is throwing a few errors, so it's leading me to believe the issue is with how I have the focusable element attached. I'm using a combination of -UIFocusLoggingEnabled YES as well as listening for UIFocusSystem.movementDidFailNotification. Unfortunately since this is SwiftUI, the notification failure and debugging logs aren't really all that actionable. Help appreciated!
Posted Last updated
.
Post not yet marked as solved
0 Replies
403 Views
I am trying to Execute Universal Link of Netflix show from My App in tvOS 17.2 When I Call the open(_:options:completionHandler:) to execute the Link it does open the Netflix App but open the landing page of Title. I have tried different alternative links but all has same behaviour. The same Link works in iOS ans iPad OS. Here the links that I have tried and the code that handles the universal Link. http://www.netflix.com/title/81731618 nflx://www.netflix.com/title/81731618 // Handle remote notification here // For example, extract deep link and perform appropriate action if let deepLink = userInfo["deep_link_key"] as? String { // Handle the deep link here print("Received Deep Link: \(deepLink)") if let url = URL(string: deepLink) { UIApplication.shared.open(url) } } }
Posted
by cylon147.
Last updated
.
Post not yet marked as solved
0 Replies
391 Views
How to implement Player in SwiftUI with support for parental controls? Sample Code: Working with Overlays and Parental Controls in tvOS I use AVPlayerViewController in SwiftUI. On cancel, rejecting the request, the screen is black. On change the channel, on move command up or down direction, I am replacing the current player item with new. Status is ready to play, status of the request is successful upon replacement and I set player to play. The screen is still black.
Posted
by ina4.
Last updated
.
Post not yet marked as solved
0 Replies
317 Views
I am trying to write to a characteristic and I know that it needs to be paired via a pin/passcode in order to initiate transfer of data. But it only pairs with 'just works' method and does not allow for transfer for data. Is connecting possible with pin/passcode via BLE on TVOS? Seems like it's not.
Posted
by JSyquia.
Last updated
.