从 Google Play Games SDK v2 获取 GamesClient 实例

问题描述 投票:0回答:1

当前的 Google Play Games SDK (v2:20.1.2) 定义了

GamesClient
接口,这是我需要的
getSettingsIntent
。但是,我无法弄清楚如何获取它的实例。对于其他接口,如
LeaderboardClient
AchievementClient
PlayGames
中有静态get方法,但没有
getGamesClient
方法。有什么想法吗?

android google-play-services google-play-games
1个回答
0
投票

根据文档PlayGames是一个类而不是接口并且没有方法可以在那里获取GamesClient。

- static AchievementsClient 
getAchievementsClient(Activity activity)
Returns a new instance of AchievementsClient for use in an Activity.
- static EventsClient   
getEventsClient(Activity activity)
Returns a new instance of EventsClient for use in an Activity.
- static GamesSignInClient  
getGamesSignInClient(Activity activity)
Returns a new instance of GamesSignInClient for use in an Activity.
- static LeaderboardsClient 
getLeaderboardsClient(Activity activity)
Returns a new instance of LeaderboardsClient for use in an Activity.
- static PlayerStatsClient  
getPlayerStatsClient(Activity activity)
Returns a new instance of PlayerStatsClient for use in an Activity.
- static PlayersClient  
getPlayersClient(Activity activity)
Returns a new instance of PlayersClient for use in an Activity.
- static RecallClient   
getRecallClient(Activity activity)
Returns a new instance of RecallClient for use in an Activity.
- static SnapshotsClient    
getSnapshotsClient(Activity activity)
Returns a new instance of SnapshotsClient for use in an Activity.

GamesClient 是一个您需要自己实现的接口,并将您自己的逻辑添加到其中声明的方法中。

© www.soinside.com 2019 - 2024. All rights reserved.