The following Game Center API is available with IOS Native on TvOS platform.
Setup and init Game Center as you normally do with IOS platform. See the Initialize Game Center Guide.
With TvOS the following API is available for you:
There is some usage difference between IOS and TvOS platforms.
- You can't show specifically Achievements UI, Leaderboard UI or Leaderboard Data UI by its Id. You can only show single Game Center window. Any action like Show Leaderboards / Achievements will now trigger standard TvOs Game Center interface.
- The Leaderboards data will not appear inside the TvOs Game Center interface until Xcode setup action is completed which is described bellow:
- Select Images.xcassets in Xcode project
- Right-click under listed files and from the menu pick Game Center->New AppleTV Leaderboard.
- Add your images there.
- Select Leaderboard and on the right pane pick edit view. Find there “Identifier” field and enter you leaderboard id there.
- If after these modifications your asset compilation starts to fail, try disabling “On Demand Resources” in Xcode “Build Settings”.
We would also recommend reading the Building games for Apple TV Unity Guide before you begin.
When you are submitting your achievements progress, the following log message may appear:
no bundle for bundleID: (null)
This message is harmless, however, there is no explanation from Apple about message source. See the Developers Forum for more information.
You should understand that unlike mobile games, when modal overlay covers the screen (like ,for example, popup or achievements window appears) this overlay is not blocking input from the remote which means your game or game menu will still read and respond to TV remote input.
Here is a workaround that we can suggest.
- When you are presenting any modal view like Show Achievements / Leaderboards. Lock your input listeners.
- Subscribe to the GameCenterManager.OnGameCenterViewDismissed event
- Enable input listeners once GameCenterManager.OnGameCenterViewDismissed has been fired and unsubscribe from the event.