• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
Question by o___O · May 22, 2018 at 11:11 AM · gamecenterleaderboards

Gamecenter does not work on AppleTV

Greetings. We use the Game Center in our game. In the IOS everything works. On AppleTB Leaderboards are shown for the first time, but when the second leaderboard call is played, the game hangs with an error "We failed to present Game Center dashboard extension."

Comment

People who like this

0 Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image paatz04 · Aug 24, 2019 at 12:57 PM 0
Share

Same issue here...

avatar image leenk · Sep 04, 2019 at 11:55 PM 0
Share

For anyone stuck on this, we have heard that the problem is caused by not having "Apple TV Dashboard Images" set up. We have not yet confirmed that this works, but are trying it out now.

I found a reference to this solution on this SO question:

https://stackoverflow.com/questions/34406727/game-center-in-tvos-not-showing-up

2 Replies

· Add your reply
  • Sort: 
avatar image

Answer by leenk · Sep 04, 2019 at 09:17 PM

@o___O @paatz04 - Did anyone manage to find an answer to this issue? We're in a bit of an emergency situation over this right now, and any tips or advice would be a lifesaver! Thanks!

Comment

People who like this

0 Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image leenk · Sep 04, 2019 at 09:47 PM 0
Share

In XCode, the game freezes for a few seconds, and then we see the error:

"We failed to present Game Center dashboard extension"

avatar image XtremeDry leenk · Sep 18, 2019 at 08:14 AM 0
Share

@leenk @paatz04 Any update on this? we are also seeing the same issue. :/ Thanks.

avatar image joe_nk XtremeDry · Sep 18, 2019 at 11:04 PM 0
Share

@XtremeDry See the answer I posted.

avatar image

Answer by joe_nk · Sep 18, 2019 at 11:03 PM

The issue appears to be a problem with the Game Center View Controller on tvOS not being able to cope with the view not having a 'Dashboard Image' You can fix this by adding one in the xcode project manually inside the UnityImages.xcassets folder:

alt text

After adding this you'll probably get a build error like this:

 On-Demand Resources is enabled (ENABLE_ON_DEMAND_RESOURCES = YES),
 but the PRODUCT_BUNDLE_IDENTIFIER build setting is empty



This means you need to set your PRODUCT_BUNDLE_IDENTIFIER in the project build settings - Unity doesn't do this for you.

alt text

We were able to automate both of these steps with the following script:

 using System;
 using System.IO;
 using UnityEditor;
 using UnityEditor.Callbacks;
 using UnityEditor.iOS.Xcode;
 
 using Newtonsoft.Json;
 
 namespace BuildAutomation {
 #if UNITY_TVOS
     public class BuildScript {
         [Serializable]
         class XCodeImageSet {
             [Serializable]
             public class Info {
                 public int version = 0;
                 public string author = null;
             }
 
             [Serializable]
             public class Image {
                 public string idiom = null;
                 public string filename = null;
                 public string scale = null;
             }
 
             public Info info = null;
             public Image[] images = null;
         }
 
         [PostProcessBuild]
         public static void OnPostprocessBuild(BuildTarget buildTarget, string path) {
             string projPath = PBXProject.GetPBXProjectPath(path);
 
             var proj = new PBXProject();
             proj.ReadFromString(File.ReadAllText(projPath));
 
             var target = proj.TargetGuidByName(PBXProject.GetUnityTargetName());
 
             proj.SetBuildProperty(target, "PRODUCT_BUNDLE_IDENTIFIER", UnityEngine.Application.identifier);
             
             File.WriteAllText(projPath, proj.WriteToString());
 
             const string dbImageName = "tvOs_DashboardArtwork";
             const string dbImageFolder = "DashboardImage";
             string dbImagePath = $"{path}/UnityImages.xcassets/{dbImageFolder}.gcdashboardimage/{dbImageFolder}.imageset/";
             Directory.CreateDirectory(dbImagePath);
 
             string[] imageAssetGuids = AssetDatabase.FindAssets(dbImageName);
 
             XCodeImageSet imageSet = new XCodeImageSet {
                 info = new XCodeImageSet.Info {
                     version = 1,
                     author = "com.yourcompany",
                 },
                 images = new XCodeImageSet.Image[imageAssetGuids.Length]
             };
 
             for (int i = 0; i < imageAssetGuids.Length; ++i) {
                 string fileGuid = imageAssetGuids[i];
                 string filePath = AssetDatabase.GUIDToAssetPath(fileGuid);
                 string fileName = Path.GetFileName(filePath);
 
                 imageSet.images[i] = new XCodeImageSet.Image{
                     idiom = "tv",
                     filename = fileName,
                     scale = fileName.Contains("@2x") ? "2x" : "1x",
                 };
 
                 File.Copy(filePath, dbImagePath + fileName);
             }
 
             File.WriteAllText(
                 dbImagePath + "Contents.json",
                 JsonConvert.SerializeObject(imageSet)
             );
         }
     }
 #endif
 }



If using this script, just make sure you have the images named tvOs_DashboardArtwork.png and tvOs_DashboardArtwork_@2x.png somewhere in your Assets folder. Guidelines for the image dimensions can be found here

Hope this helps others having this issue!


screenshot-2019-09-19-at-104323-am.png (34.9 kB)
dashboardimage.jpg (179.3 kB)
Comment
leenk
daniel_unity938

People who like this

2 Show 8 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image paatz04 · Sep 19, 2019 at 12:22 AM 0
Share

Thanks for sharing this, I've followed this steps before - and it will open twice but there is a long (waiting for a timeout) Is there a specific naming convention, or rule for the actual images - when adding them manually to xcode I don't get any errors. Thank you!

avatar image joe_nk paatz04 · Sep 19, 2019 at 01:05 AM 1
Share

We're not seeing this issue but we're not using Game Center leaderboards, which I think you are? So there could be a separate issue there.. We just added the 'Apple TV Dashboard Image' (pngs - one at 923x150 and another @2x). Guidelines for these images can be found here: https://developer.apple.com/design/human-interface-guidelines/tvos/icons-and-images/game-center-images/

avatar image paatz04 joe_nk · Sep 19, 2019 at 01:06 AM 0
Share

I'm only using achievements. I just added two transparent images in the right dimensions

Show more comments
avatar image daniel_unity938 · Dec 03, 2019 at 03:47 AM 0
Share

Can confirm, works for me.

avatar image fedemg15 · Jan 24, 2020 at 08:07 PM 0
Share

Hey! Thank you so much for sharing this solution.

Sorry i came late to the party, but implementing this I've stumbled into a couple discoveries that might be helpful regarding the code.

  1. As Newtonsoft requires you to add an additional plugin, I've been able to get the json serialized using the UnityEngine's JsonUtility.ToJson() function. ( so 'using UnityEngine' is required for that function)

  2. As this code requires Editor data, you'll have to add this script to an 'Editor' folder, for it to be processed after building and being able to access Editor values. More info on Special Folders can be found here.

I'm not sure if this is obvious, but I just wanted to point that out.

Cheers!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

143 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to load a specific Game Center leaderboard? 1 Answer

GameCenter Leaderboard Reporting Scores 1 Answer

How can i Implement iOS GameCenter leaderboards in my game? 1 Answer

Why isn't this script posting the score to Google Play Leaderboards? 2 Answers

Weekly Leader boards using google play services 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges