I have a music app I'm developing and having a weird issue where I can see now playing info for every other platform than tvOS. As far as I can tell I have correctly configured the MPNowPlayingInfoCenter
MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo MPNowPlayingInfoCenter.default().playbackState = .playing
Are there any extra requirements to get my app's now-playing info showing in control center on tvOS? Another strange issue that might be related is I can use the apple TV remote to pause audio but not resume playback, so I feel like there's something I'm missing about registering audio playback on tvOS specifically.
Posts under tvOS tag
87 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I'm encountering an issue with In-App Purchases on Apple TV (tvOS):
When a user initiates an IAP for the first time, the system prompts them to sign in with their Apple ID, and the purchase proceeds normally.
However, on subsequent purchase attempts, if the Apple ID session has expired or additional verification is required, the system redirects the user to the Settings app to sign in again.
After the user signs in via Settings, the app does not automatically return to the foreground. The user must manually press the Menu button to come back.
Is this is the normal behaviour of apple tv for InApp purchase? or did I need any code improvement to solve this?
What I'm trying to achieve:
I'd like the app to automatically return to the foreground once the user has completed the Apple ID login in Settings. Is this behavior supported on tvOS? If not, is there any known workaround or best practice to guide the user back to the app smoothly?
Any advice or guidance from Apple or other developers would be greatly appreciated!
Hi Apple Developer Team,
In my tvOS app built with SwiftUI, I have a tab-based interface with several sections. The first tab (index 0) is the Home tab. Other tabs include Contact, WiFi, Welcome, etc.
I want to handle the remote's Menu / Back button (.onExitCommand) so that:
If the user is on any tab other than Home (tabs 1, 2, 3, etc.), pressing the Menu button takes them back to the Home tab.
If the user is already on the Home tab, then pressing the TV/Home button (not Menu) behaves as expected — suspending or exiting the app (handled by the system, no code involved).
Here's a simplified version of what I implemented:
.onExitCommand {
if selectedTab != 0 {
selectedTab = 0
focusedTab = 0
} else {
// Let system handle the exit when user presses the TV/Home button
}
}
This behavior ensures users don’t accidentally exit the app when they're browsing other tabs, and provides a consistent navigation experience.
Question:
Is this an acceptable and App Store-compliant use of .onExitCommand on tvOS?
I'm not calling exit(0) or trying to force-terminate the app — just using .onExitCommand for in-app navigation purposes.
Any official guidance or best practices would be greatly appreciated!
Thanks,
Prashant
Summary:
When using the new .focused modifier to track focus within a large LazyVStack or LazyHStack, we observe a major frame-rate drop and stuttering on Apple TV (1st and 2nd generation).
Steps to Reproduce:
Create a LazyVStack (or LazyHStack) displaying a substantial list of data models (e.g., 100+ GroupData items).
Attach the .focused(::) modifier to each row, binding to an @FocusState variable of the same model type.
Build and run on an Apple TV device or simulator.
Scroll through the list using the remote.
static func == (lhs: GroupData, rhs: GroupData) -> Bool {
lhs.id == rhs.id
}
var id: String
var name: String
var subName: String
var subGroup: [GroupData] = []
var logo: URL?
}
struct TestView: View {
@FocusState var focusedGroup: GroupData?
let groupsArr: [GroupData]
var body: some View {
ScrollView {
LazyVStack {
ForEach(groupsArr, id: \.id) { group in
Button {
} label: {
GroupTestView(group: group)
}
.id(group.id)
.focused($focusedGroup, equals: group)
}
}
}
}
}
struct GroupTestView: View {
let group: GroupData
var body: some View {
HStack {
KFImage.url(group.logo)
.placeholder {
Image(systemName: "photo")
.opacity(0.2)
.imageScale(.large)
}
.resizable()
.scaledToFit()
.frame(width: 70)
VStack {
Text(group.name)
Text(group.subName)
}
}
}
}
Expected Behavior
Scrolling remains smooth (60 fps) regardless of list size.
Focus updates without introducing visible lag.
Observed Behavior
Frame rate drops significantly when .focused is applied.
Scrolling becomes visibly laggy, especially on older Apple TV hardware.
Even when binding an @FocusState<String?> (storing only the id), performance improves slightly but remains suboptimal.
Workarounds Tried
Switched to @FocusState of type String to track only the ID of each group, this has helped but there is still a big performance decrease.
Minimised view-body complexity and removed other modifiers.
Verified that excluding .focused entirely restores smooth scrolling.
Any guidance or suggestions would be greatly appreciated.
I've been looking for a solution to configure the Apple TV remote(s) from the 5th generation and upwards.
Some of the basic functionalities are disabling buttons on the physical remote control while maintaining proper functionality on remote controller apps on iOS devices.
There seems to be a lack of relevant entitlements in that category, and without it I can't seem to figure out a way to make it work.
Any ideas on the matter?
Maybe a workaround that allows to configure the Apple TV to work with other remotes?
Thank you in advance to anyone that put in thought to my query.
Hi,
Having a weird issue that I’m noticing on Apple TVs with some apps that are by the same company. I think it’s storing residual user data if if you delete the app and all other apps relating to this. I have even tried deleting every app and reinstalling but we found two apps to be still logged in. Seams like a sandboxing bug and I presume it’s to do with App data stored in the shared app groups.
I can only reset the apple tv to remove the user data. The two apps we can see are being persistent is Binge and Kayo by streamotion.
We have tried problem solving this in every way imaginable but it’s Interesting that this is allowed to happen on an Apple platform. There is no active user logged into the apple TV with an Apple ID either
When attempting to replicate the tvOS Settings menu layout, where the screen is divided horizontally into two sections, placing a NavigationStack or a Form view on either side of the screen causes focusable views (such as Button, TextField, Toggle, etc.) to be visually clipped when they receive focus and apply the default scaling animation.
Specifically:
If the Form or NavigationStack is placed on the right side, the left edge of the focused view gets clipped.
If placed on the left side, the right edge of the focused view gets clipped.
This issue affects any focusable child view inside the Form or NavigationStack when focus scaling is triggered.
Example code:
struct TVAppMenuMainView: View {
var body: some View {
VStack {
Text("Settings Menu")
.font(.title)
HStack {
VStack {
Text("Left Pane")
}
.frame(width: UIScreen.main.bounds.width * 0.4) // represents only 40% of the screen
.frame(maxHeight: .infinity)
.padding(.bottom)
Divider()
NavigationStack {
Form { // All the buttons will get cut on the left side when each button is focused
Button("First Button"){}
Button("Second Button"){}
Button("Third Button"){}
Button("Forth Button"){}
}
}
}
.frame(maxHeight: .infinity)
.frame(maxWidth: .infinity)
}
.background(.ultraThickMaterial)
}
}
How it looks:
What I have tried:
.clipped modifiers
.ignoresSafeArea
Modifying the size manually
Using just a ScrollView with VStack works as intended, but as soon as NavigationStack or Form are added, the buttons get clipped.
This was tested on the latest 18.5 tvOS BETA
Hello,
We are working on a real-time 2-player online game targeting multiple Apple devices. The following issue only occurs on tvOS:
When selecting matchmaking to connect with another player, the native Game Center interface opens and begins the matchmaking process.
Almost immediately, the following log appears in the console, and the matchmaking screen remains indefinitely without completing:
Timeout while starting matching with request: <GKMatchRequestInternal 0x30d62f690> {
defaultNumberOfPlayers : 0
isLateJoin : 0
localPlayerID : U:bea182d69b85f0839e3958742fbc4609
matchType : 0
maxPlayers : 2
minPlayers : 2
playerAttributes : 4294967295
playerGroup : 1
preloadedMatch : 0
recipientPlayerIDs : <__NSArrayM 0x3034ed5c0> {}
recipients : <__NSArrayM 0x3034ee280> {}
restrictToAutomatch : 0
version : 1
archivedSharePlayInviteeTokensFromProgrammaticInvite, inviteMessage, localizableInviteMessage, messagesBasedRecipients, properties, queueName, recipientProperties, rid, sessionToken : (null)
} . Error: (null)
However, the task does not complete when the log appears (our Debug.Log are nerver called).
But if we manually cancel the matchmaking process, the "User cancel" log is correctly triggered.
Here is a code snippet for the request :
var gkMatchRequest = GKMatchRequest.Init();
gkMatchRequest.MinPlayers = 2;
gkMatchRequest.MaxPlayers = 2;
var matchRequestTask = GKMatchmakerViewController.Request(gkMatchRequest);
matchRequestTask.ContinueWith(t => { Debug.LogException(t.Exception); }, TaskContinuationOptions.OnlyOnFaulted);
matchRequestTask.ContinueWith(t => { Debug.LogInfo("User cancel"); }, TaskContinuationOptions.OnlyOnCanceled);
matchRequestTask.ContinueWith(t => { Debug.LogInfo("Success"); }, TaskContinuationOptions.OnlyOnRanToCompletion);
We have tested this on multiple devices and network types (Wi-Fi, 5G, Ethernet), but we consistently encounter this bug along with the same log message.
Could you please help us understand or resolve this issue?
Thank you.
Hello !
We are working on a real-time 2-player online game targeting multiple Apple devices.
The following issue only occurs on tvOS:
When selecting matchmaking to connect with another random player, the native Game Center interface opens and begins the matchmaking process.
Almost immediately after clicking "start", the following log appears in the console, and the matchmaking screen remains indefinitely without completing:
Timeout while starting matching with request: <GKMatchRequestInternal 0x30d62f690> {
defaultNumberOfPlayers : 0
isLateJoin : 0
localPlayerID : U:bea182d69b85f0839e3958742fbc4609
matchType : 0
maxPlayers : 2
minPlayers : 2
playerAttributes : 4294967295
playerGroup : 1
preloadedMatch : 0
recipientPlayerIDs : <__NSArrayM 0x3034ed5c0> {}
recipients : <__NSArrayM 0x3034ee280> {}
restrictToAutomatch : 0
version : 1
archivedSharePlayInviteeTokensFromProgrammaticInvite, inviteMessage, localizableInviteMessage, messagesBasedRecipients, properties, queueName, recipientProperties, rid, sessionToken : (null)
} . Error: (null)
However, as shown in the code snippet below, the task does not complete when the log appears. But when we manually cancel the matchmaking process, the "User cancel" log is correctly triggered.
var gkMatchRequest = GKMatchRequest.Init();
gkMatchRequest.MinPlayers = 2;
gkMatchRequest.MaxPlayers = 2;
var matchRequestTask = GKMatchmakerViewController.Request(gkMatchRequest);
matchRequestTask.ContinueWith(t => { Debug.LogException(t.Exception); }, TaskContinuationOptions.OnlyOnFaulted);
matchRequestTask.ContinueWith(t => { Debug.Log("User cancel"); }, TaskContinuationOptions.OnlyOnCanceled);
matchRequestTask.ContinueWith(t => { Debug.Log("Success"); }, TaskContinuationOptions.OnlyOnRanToCompletion);
We have tested this on multiple Apple TV and network types (Wi-Fi, 5G, Ethernet), but we consistently encounter this bug along with the same log message.
Could you please help us understand or resolve this issue?
Thank you.
When running UITests on tvOS, tabBar viewIdentifiers (UIKit) are no longer appearing. When you run the test, accessibility identifiers for tabs are no longer locatable but all other identifiers appears except for the tabs in the tabBar. In the stack trace of the debugger, if I print application, I can see all existing viewIdentifiers except those that were set for the tabs (on tvOS only).
If I force an action on the simulator after the app has launched and the view appeared ie move left or right, the identifiers appears (confirmed by stack trace) and the test will continue as expected. This was not an issue in the past (no code changes). I am not sure if this appeared after updating my mac to Sequoia. But for iOS, there is no issue. This bug only appears on tvOS and specifically the tabs.
Issue persists on:
Sequoia 15.4.1
Xcode 16.3
Hi,
This maybe somewhat confusing, but please bear with me.
I currently have an app in the App Store that supports iOS and tvOS. But the tvOS version was a separate app during the development process. I'd like to combine the iOS and tvOS app into one project so its easier to handle and keep track of internally.
Can I upload the new Apple TV version to the same place where the current one is, or would I have to delete the current Apple TV version before uploading the newly combined version?
I hope I made that clear enough :-)
Thank you,
Dan Uff
I noticed a discrepancy between the Material specifications for tvOS on the Developer page and the naming in the Design Resources (Sketch files). Which one should we consider authoritative?
https://developer.apple.com/design/human-interface-guidelines/materials
Hi everyone,
I'm facing an issue where I cannot write a file to a shared App Group container in my tvOS app when running on a real device. My code works perfectly on the simulator, but fails on a physical device with a permissions error. I’ve set up an App Group with a custom identifier (e.g., group.<my.identifier>), and it’s correctly configured in the Capabilities section of Xcode for both my main app and widget targets.
Here’s the code I’m using to save a test file:
func saveTestFile() {
guard let groupURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.<my.identifier>") else {
print("Couldn't access the Group URL.")
return
}
let containerURL = groupURL.appendingPathComponent("Library", isDirectory: true)
if FileManager.default.isWritableFile(atPath: containerURL.path) {
print("Directory IS writable")
} else {
print("Directory IS NOT writable")
}
let fileURL = containerURL.appendingPathComponent("test.txt")
let content = "Hello App Group!"
do {
try content.write(to: fileURL, atomically: true, encoding: .utf8)
print("File test.txt is saved at: \(fileURL.path)")
} catch {
print("Error while saving the file: \(error)")
}
}
Console:
Directory IS NOT writable
Error while saving the file: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “test.txt” in the folder “”." UserInfo={NSFilePath=/private/var/mobile/Containers/Shared/AppGroup//Library/test.txt, NSURL=file:///private/var/mobile/Containers/Shared/AppGroup//Library/test.txt, NSUnderlyingError=0x14387fbe0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
I’ve tried saving the file in different subdirectories within the App Group container:
Directly in groupURL (root of the container).
In groupURL.appendingPathComponent("Library").
In groupURL.appendingPathComponent("Caches").
Do you have any ideas what is the problem?
Thanks in advance for any help!
Hi everyone,
I'm working on a tvOS app using SwiftUI, and I want to disable the focus effect (the default focus glow/bounce) on a specific Button. According to the documentation:
/// - Parameter disabled: A Boolean value that determines whether this view
/// can display focus effects.
/// - Returns: A view that controls whether focus effects can be displayed
/// in this view.
I used .focusEffectDisabled(true) on the Button, expecting the focus style to be completely disabled for that view. However, this doesn’t seem to have any effect in my tvOS 17+ app – the button still shows the default focus visual effect when focused.
Here’s a simplified example:
Button("Click Me") {
// action
}
.focusEffectDisabled(true)
This still shows the bounce/glow focus effect. Am I missing something, or is this a bug?
Has anyone managed to fully disable the focus effect for a view (especially Button) in tvOS using SwiftUI? Any workarounds or additional modifiers I should apply?
Thanks in advance!
Hi,
I'm trying to fix tvOS view for VoiceOver accessibility feature:
TabView { // 5 tabs
Text(title)
Button(play)
ScrollView { // Live
LazyHStack { 200 items }
}
ScrollView { // Continue watching
LazyHStack { 500 items }
}
}
When the view shows up VoiceOver reads:
"Home tab 1 of 5, Item 2" - not sure why it reads Item 2 of the first cell in scroll view, maybe beacause it just got loaded by LazyHStack.
VocieOver should only read "Home tab 1 of 5"
When moving focus to scroll view it reads:
"Live, Item 1" and after slight delay "Item 1, Item 2, Item 3, Item 4"
When moving focus to second item it reads:
"Item 2" and after slight delay "Item 1, Item 2, Item 3, Item 4"
When moving focus to third item it reads:
"Item 3" and after slight delay "Item 1, Item 2, Item 3, Item 4"
It should be just reading what is focused, idealy just
"Live, Item 1, 1 of 200"
then after moving focus on item 2
"Item 2, 2 of 200"
this time without the word "Live" because we are on the same scroll view (the same horizontal list)
Currently the app is unusable, we have visually impaired testers and this rotor reading everything on the screen is totaly confusing, because users don't know where they are and what is actually focused.
This is a video streaming app and we are streaming all the time, even on home page in background, binge plays one item after another, usually there is never ending Live stream playing, user can switch TV channel, but we continue to play. Voice over should only read what's focused after user interaction.
Original Apple TV app does not do that, so it cannot be caused by some verbose accessibility settings. It reads correctly only focused item in scrolling lists.
How do I disable reading content that is not focused?
I tried:
.accessibilityLabel(isFocused ? title : "")
.accessibilityHidden(!isFocused)
.accessibilityHidden(true) - tried on various levels in view hierarchy
.accessiblityElement(children: .ignore) - even focused item is not read back by voice over
.accessiblityElement(children: .ignore) - even focused item is not read back by voice over
.accessiblityElement(children: .contain) - tried on various levels in view hierarchy
.accessiblityElement(children: .combine) - tried on various levels in view hierarchy
.accessibilityAddTraits(.isHeader) - tried on various levels in view hierarchy
.accessibilityRemoveTraits(.isHeader) - tried on various levels in view hierarchy
// the last 2 was basically an attempt to hack it
.accessibilityRotor("", ranges []) - another hack that I tried on ScrollView, LazyHStack, also on top level view.
50+ other attempts at configuring accessibility tags attached to views.
I have seen all the accessibility videos, tried all sample code projects, I haven't found a solution anywhere, internet search didn't find anything, AI didn't help as it can only provide code that someone else wrote before.
Any idea how to fix this?
Thanks.
Hi,
I got a problem with severe hangs when I use code like this on tvOS 18.2
If I try to use HStack instead of LazyHStack inside the scrollview then the problem does not occur any more but then the scroll performance is compromised and the vertical scroll is no longer that smooth. Does someone has any experience with this? Is this SwiftUI problem or am I missing something?
ScrollView {
LazyVStack {
ForEach(0...100, id: \.self) { _ in
ScrollView {
LazyHStack {
ForEach(0...20, id: \.self) { _ in
Color.red.frame(height: 300)
}
}
}
}
}
}
We're building an SDK (let's call it MyFramework) which is distributed as an .xcframework for developers to integrate it into their own apps.
Recently, we've added tvOS support by adding it as a supported destination for the SDK. Essentially, the SDK became a cross-platform framework and easy to be adopted in both iOS and tvOS apps.
The .xcframework is generated fine, all builds correctly. We've tested the SDK integrated in test apps. We've also submitted an iOS archive app to the AppStore connect, just to make sure all is well with the AppStore submission.
However, when I tried submitting a tvOS archive app (that integrates the same SDK) to the AppStore connect, the build was marked as invalid binary and we've got the following error message:
ITMS-90562: Invalid Bundle - One of the nested bundles is built for a platform which is different from the main bundle platform. Please make sure that all bundles have correct platform specification.
First, I thought that any of the modules of the framework was not correctly configured for tvOS but that was not the case. Everything compiles ok and it runs in debug as expected.
It only fails when trying to submit the tvOS app that integrates the SDK.
After a lot of investigating, we realised that the reason for the AppStore submission error is because we codesign the framework. We use codesign to distribute it as cryptographically signed xcframework.
codesign --timestamp -v --sign "Apple Distribution: Company (xxxxxxxxxx)" "MyFramework.xcframework"
As soon as we remove the above line from our CI/CD pipeline that generates the xcframework, and submit a tvOS archive app that integrates the unsigned framework, the AppStore submission error goes away and the TestFlight build can be tested.
I've also tried to just strip the _CodeSignature folder from the .xcframework package but it still fails. So the only solution currently is to not codesign the xcframework to be able to upload tvOS archive apps that integrate the SDK to the AppStore connect.
However, we're still puzzled as to why only the tvOS archive app gets the invalid binary error when it integrates a signed SDK. I feel like the error message is quite misleading if we have to stop signing the SDK xcframework for it to be accepted during the AppStore submission.
Anyone has any idea? Or has anyone encountered a similar issue?
Thanks!
Since tvOS 18, my Picker view with inline style is not showing the checkmark on the selected item.
enum Flavor: String, Identifiable {
case chocolate, vanilla, strawberry
var id: Self { self }
}
struct ContentView: View {
@State private var selectedFlavor: Flavor = .chocolate
var body: some View {
NavigationView {
Form {
Picker("Flavor", selection: $selectedFlavor) {
Text("Chocolate").tag(Flavor.chocolate)
Text("Vanilla").tag(Flavor.vanilla)
Text("Strawberry").tag(Flavor.strawberry)
}.pickerStyle(.inline)
}
}
}
}
Am I missing something? When I run this on tvOS 17.x, it works fine.
In tvOS when using NavigationStack inside NavigationSplitView as below:
@State private var selectedItem: String?
@State private var navigationPath = NavigationPath() // Track navigation state manually
var body: some View {
NavigationSplitView {
List(selection: $selectedItem) {
Button("Item 1") { selectedItem = "Detail View 1" }
Button("Item 2") { selectedItem = "Detail View 2" }
}
} detail: {
NavigationStack(path: $navigationPath) {
DetailView()
.navigationDestination(for: String.self) { value in
Text("New Screen: \(value)")
}
}
}
}
}
This example completely breaks the animation inside NavigationStack while navigating between different views, using withAnimation also breaks the navigation as the old view seems to be still in stack and is shown in the new view background.
I have also submitted bug report: https://feedbackassistant.apple.com/feedback/16933927
Issue:- The characters in SearchController SearchBar are overlapping on focusing.
Steps:-
Select the System language as Arabic
Launch the tvOS app
Set the app language as English in the tvOS app
Focus on SearchController SearchBar
Focus on any characters there you can see overlapping issue.