tvOS is the operating system for Apple TV.

Posts under tvOS tag

111 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Local notifications on tvOS
Hi: I want to know how to schedule a local notification in tvOS and when you tap it, open the app. I was reading the documentation: https://developer.apple.com/documentation/usernotifications/unnotificationcontent And I don't know why the title and body, for example, are unavailable for tvOS. Any help is welcome. Thanks in advance.
0
1
581
Aug ’23
NavigationView is messing up with .prefersDefaultFocus(in:) in tvOS
I am building a tvOS app which divides the screen into two parts horizontally. Both sides have buttons. I want a certain button on the right side to have focus. To achieve that I am marking the enclosing HStack with .focusScope() and then use .prefersDefaultFocus(in:) on the button which should have focus. This works fine, even if I add another focus scope inside (see source code). But as soon as I wrap the HStack in a NavigationView it falls apart. The scope is not set as intended, instead the left view always gets the focus. Am I missing something? Is this intended? I’m a little lost right now. I am targeting tvOS 16.4 and using Xcode 14.3.1. Fun fact: The simulator view inside Xcode displays the view correctly. The simulator and an actual device are not. Here is an example to showcase that: struct ContentView: View { @Namespace private var mainNamespace @Namespace private var rightNamespace var body: some View { // NavigationView { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundColor(.accentColor) Text("Hello, world!") HStack { VStack { Button("left") {} } VStack { Button("right 1") {} Button("right 2") {} .prefersDefaultFocus(in: rightNamespace) } .focusScope(rightNamespace) .prefersDefaultFocus(in: mainNamespace) } .focusScope(mainNamespace) .padding(.top, 50) } .padding() // } } }
1
0
556
Sep ’23
Apple tv VPN appp.
Hello there, I already have a native iOS vpn app that I developed and is already on the appstore working well, I decided to support tvOS, where I downloaded apple tvOS beta 17 on real device, downloaded latest xcode beta and setup my code, when connecting to vpn it fails alwas (Ikev2), my only question is may the error be from my code (where it works well on iOS) or apple does not support the vpn connection in beta till now ?
5
0
1.6k
Sep ’23
tvOS app icon is not used in a multiplatform app
I have a multiplatform app where I support iOS, macOS and tvOS. There is one target which supports it all. In my assets catalog I have the AppIcon entry which holds the app icon for iOS and macOS. This works as expected. However the tvOS app icon is ignored. I added an "tvOS App Icon & Top Shelf Image" asset to my asset catalog and filled it with my icons for tvOS. Then I added it in the target’s general settings App Icon entry under App Icons and Launch Screen like shown in the screenshot. What am I missing? What needs to be done to make this work?
4
0
835
Jan ’24
tvOS: AVPlayerViewController.transportBarCustomMenuItems not working
Hi guys, Setting AVPlayerViewController.transportBarCustomMenuItems is not working on tvOS. I still see 2 icons for Audio and Subtitles. let menuItemAudioAndSubtitles = UIMenu( image: UIImage(systemName: "heart") ) playerViewController.transportBarCustomMenuItems = [menuItemAudioAndSubtitles] WWDC 2021 video is insufficient to make this work. https://developer.apple.com/videos/play/wwdc2021/10191/ The video doesn't say what exactly I need to do. Do I need to disable subtitle options? viewController.allowedSubtitleOptionLanguages = [] This didn't work and I still see the default icon loaded by the player. Do I need to create subclass of AVPlayerViewController? I just want to replace those 2 default icons by 1 icon as a test, but I was unsuccessful after many hours of work. Is it mandatory to define child menu items to the main item? Or do I perhaps need to define UIAction? The documentation and video are insufficient in providing guidance how to do that. I did something like this before, but that was more than 3 years ago and audi and subtitles was showing at the top of the player screen as tabs, if I rememebr correctly. Is transportBarCustomMenuItems perhaps deprecated? Is it possible that when loading AVPlayerItem and it detects audi and subtitles in the stream, it automatically resets AVPlayerViewController menu? How do I suppress this behavior? I'm currently loading AVPlayerViewController into SwiftUI interface. Is that perhaps the problem? Should I write SwiftUI player overlay from scratch? Thanks, Robert
1
0
706
Sep ’23
didSelectRowAt no longer working after tvOS 17 update
Hello, I have a UITableView that contains UITableViewCells. Before the tvOS 17 update, things were working fine - however, now didSelectRowAt is no longer working. I printed a log in the tableView method but it doesn't get invoked at all. The pressesBegan methods are still called on both the table and the cell. Checklist: allowsSelection = true Interactions Enabled (on both table and cell) channel_list_table_view.dataSource = self channel_list_table_view.delegate = self Here is the table code (omitted a lot): @IBDesignable class channel_list_view: UIView, UITableViewDelegate, UITableViewDataSource, slice_view_event_receiver, channel_list_table_cell_event_receiver { @IBOutlet weak var channel_list_table_view: UITableView! func common_init() { view = load_view_from_nib() view.frame = bounds addSubview(view) self.channel_list_table_view.allowsSelection = true /* * Register the cell nib with the table so it knows how to create cells using the identifier */ channel_list_table_view.register(UINib(nibName: "channel_list_table_cell", bundle: nil), forCellReuseIdentifier: "channel_list_table_cell") /* * Link our instance to the table as its delegate and data source */ channel_list_table_view.dataSource = self channel_list_table_view.delegate = self channel_list_table_view.remembersLastFocusedIndexPath = true /* * Left swift caises refocus on the controls bar */ let left_swipe_recogniser = UISwipeGestureRecognizer(target: self, action: #selector(swipe_gesture_occurred)) left_swipe_recogniser.direction = .left view.addGestureRecognizer(left_swipe_recogniser) } override func pressesBegan(_ presses: Set<UIPress>, with event: UIPressesEvent?) { for press in presses { if press.type == .leftArrow { event_receiver?.leave_channel_list(selected_guide_item: nil) return } } super.pressesBegan(presses, with: event) } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { // NOT GETTING CALLED } } I would appreciate any insight/help that anyone can spare. Help!
0
0
338
Sep ’23
Apple TVOS 17 VPN Packet Tunnel error
Thread 4: "*** NSExtensionPrincipalClass PacketTunnel.PacketTunnelProvider must implement at least one public protocol" warning: Module "/Users/username/Library/Developer/Xcode/tvOS DeviceSupport/AppleTV11,1 17.0 (21J354)/Symbols/usr/lib/system/libsystem_kernel.dylib" uses triple "arm64e-apple-tvos17.0.0", which is not compatible with the target triple "arm64-apple-tvos-unknown". Enabling per-module Swift scratch context. I can't run VPN. Same code IOS,MacOS are ok.
5
0
824
Oct ’23
"Not a valid bundle" trying to install app on tvos17 using Xcode 15
I'm trying to install my IPA on my Apple TV via Xcode 15. I've done this many times before with previous versions of tvos and Xcode. However, since upgrading the ATV to tvos17, I get the error below. Any ideas how to resolve this? Domain: com.apple.dt.DVTCoreDevice Code: -1 User Info: { DVTErrorCreationDateKey = "2023-09-25 12:52:18 +0000"; } -- System Information macOS Version 13.5.2 (Build 22G91) Xcode 15.0 (22265) (Build 15A240d) Timestamp: 2023-09-25T08:52:18-04:00
11
4
4.8k
Oct ’23
What `partial apply for closure #1 in closure #1 in Double.init<A>(_:)` crash is about?
I give up: I have been investigating this crash that is impacting hugely my product, without finding the cause. Crashlitics shows me that this bug started on a certain date, after I released a new version, but I can't match anything with this crash. Do you have any idea of what this could be caused from? Can you provide an example of code that could be generating this crash? Thank you 🙏🏻 Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000686d303ed870 0 libswiftCore.dylib _swift_release_dealloc + 32 1 libswiftCore.dylib bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 136 2 AppName <compiler-generated> - Line 4309475464 partial apply for closure #1 in closure #1 in Double.init<A>(_:) + 4309475464 3 libswiftCore.dylib _swift_release_dealloc + 56 4 libswiftCore.dylib bool swift::RefCounts<swift::RefCountBitsT<(swift::RefCountInlinedness)1> >::doDecrementSlow<(swift::PerformDeinit)1>(swift::RefCountBitsT<(swift::RefCountInlinedness)1>, unsigned int) + 136 5 libsystem_blocks.dylib _call_dispose_helpers_excp + 48 6 libsystem_blocks.dylib _Block_release + 252 7 libdispatch.dylib _dispatch_client_callout + 20 8 libdispatch.dylib _dispatch_main_queue_drain + 984 9 libdispatch.dylib _dispatch_main_queue_callback_4CF + 44 10 CoreFoundation __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 11 CoreFoundation __CFRunLoopRun + 1996 12 CoreFoundation CFRunLoopRunSpecific + 608 13 GraphicsServices GSEventRunModal + 164 14 UIKitCore -[UIApplication _run] + 888 15 UIKitCore UIApplicationMain + 340 16 AppName main.m - Line 18 main + 18 17 (Missing) From Xcode:
2
0
2.2k
Sep ’23
Apple TV 4k and Xcode pairing issue
I have an Apple TV 4k, and I want to pair Xcode with TV in order to install my developing app. According to this answer, I can pair them on my home network. However, I can't pair them on my company's network. I suppose that the pairing procedure is through MDNS protocol. But our company's network use whitelist strategy for MDNS service IDs. So I don't know what service ID(s) is used for pairing. Can you tell me how to setup network to make pairing work?
0
0
542
Sep ’23
tvOS 17 does not show the content of my text (.html) file
In my app I have the option to enable a help screen. This is a new view that simply shows a .html file. It works fine until tvOS 16.1 In tvOS 17.0 the screen is blank. Any ideas? This is how it looks in tvOS 16.1 This is tvOS 17.0 textView.backgroundColor = SKColor.white textView.isScrollEnabled = true textView.clipsToBounds = true textView.layer.cornerRadius = 20.0 textView.textColor = SKColor.black textView.isUserInteractionEnabled = true; textView.isScrollEnabled = true; textView.showsVerticalScrollIndicator = true; textView.bounces = true; textView.panGestureRecognizer.allowedTouchTypes = [NSNumber(value: UITouch.TouchType.indirect.rawValue)] if let htmlPath = Bundle.main.url(forResource: NSLocalizedString("manual", tableName: nil, comment: ""), withExtension: "html") { do { let attributedStringWithHtml:NSAttributedString = try NSAttributedString( url: htmlPath, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil ) self.textView.attributedText = attributedStringWithHtml } catch { print("Error loading text") } }
1
0
422
May ’24
Cloudkit discrepancy between tvOS and iOS
Hi, I have an application that would require sync between iOS and tvOS devices. The cloudkit saving/loading code is exactly the same for both platforms but the data does not seems to be synchronised between the 2 devices. Even when I tried to output the data that was updated, iOS only show the data: CKRecord: 0x123456789> whereas tvOS showed more details like: CKRecord: 0x987654321; recordType=SavedGame, recordID=save_file.dat:(_defaultZone:__defaultOwner__), recordChangeTag=ln2rxsh8, values={ data = "<CKAsset: ??; referenceSignature={length = 21, bytes = 0x??????}, path=~/Library/Caches/save_file.dat, size=8005, UUID=?????, signature={length = 21, bytes = 0x?????????}, wrappedAssetKey=<24 bytes>>"; *I replaced the actual data information with ???? Although both have the exact same uploading code, I am having difficulty synchronising between both devices. Not sure what other settings did I missed out to ensure that both can be synchronised properly. Both are using the same iCloud account and apple account. Would appreciate any help. Thank you.
0
0
350
Oct ’23
100% CPU - Interface Builder for tvOS
Anyone else getting 100% CPU usage when using Interface Builder for tvOS projects on Xcode 15.0? To reproduce, simply create a new project (Obj C or Swift), select "Storyboard interface" and add a blank UIViewController to the storyboard. Note: Observed launchd_sim and PineBoard processes in Mac Activity Monitor app. Processes will stay at 98-100% until project is closed. (No issue with iOS projects.)
2
0
474
Oct ’23
Issues Detecting Apple TV's HDR Playback Capability
I've been working with the eligibleforhdrplayback property to determine if HDR playback is supported. However, I've noticed an inconsistency. When the video format switches from HDR to SDR in settings menu on Apple TV, the property still returns true, indicating HDR is playable even when it's not (This seems to contradict what was mentioned around the [20:40] mark of this WWDC video). I've tried using the eligibleForHDRPlaybackDidChangeNotification and even restarted the app, but I still encounter the same issue. Are there alternative approaches to accurately determine if the app can play HDR content on Apple TV?
0
0
424
Oct ’23
NavigationLinks embedded in a List getting clipped in tvOS
I want to recreate an user experience like in the settings app in tvOS. Therefore I have a HStack with some content on the left side and a List of NavigationLinks on the right side. However a focused link in the list gets clipped on the left side. I tried paddings and spacers and what not, but nothing helped. Is this is a bug or am I missing something? Here is some example code to show the problem: struct ContentView: View { var body: some View { NavigationStack { HStack(spacing: 20) { VStack(alignment: .center) { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") } List { ForEach(SomeViewEnum.allCases) { someView in NavigationLink(someView.rawValue, value: someView) } } .navigationDestination(for: SomeViewEnum.self) { someView in Text(someView.rawValue) } } } } } And a screenshot to show the problem:
0
0
419
Oct ’23
Flutter Support on tvOS application
Hi everyone, We have native tvOS application in OTT domain ,Which is in live To this application we would like to add flutter module, and this flutter module business logic and api's but not any UI,Currently we are in the starting stage and from flutter official document we came to know that there is no official support for tvOS by Flutter. We are working on a hack to have flutter dependencies in Apple TV app,In flutter module we are only having business logic and algorithms but not any UI elements So we would like to will Apple approve an Apple TV application with flutter module in it Thanks Waseem Akram.
1
2
782
Oct ’23