void CreateClient() { string id = GamerPlatformSettings.Instance.PlayerId; var builder = new GoogleApiClientBuilder(AppMain.Activity, this, this); builder.AddApi(Android.Gms.Games.GamesClass.Api); builder.AddScope(Android.Gms.Games.GamesClass.ScopeGames); builder.SetGravityForPopups((int)GravityForPopups); builder.SetViewForPopups(AppMain.Current.RootView); if (!string.IsNullOrEmpty(id)) { builder.SetAccountName(id); } _client = builder.Build(); }
private void CreateClient() { // did we log in with a player id already? If so we don't want to ask which account to use var settings = this.activity.GetSharedPreferences("googleplayservicessettings", FileCreationMode.Private); var id = settings.GetString("playerid", String.Empty); var builder = new GoogleApiClientBuilder(activity, this, this); builder.AddApi(Android.Gms.Games.GamesClass.Api); builder.AddScope(Android.Gms.Games.GamesClass.ScopeGames); builder.SetGravityForPopups((int)GravityForPopups); if (ViewForPopups != null) { builder.SetViewForPopups(ViewForPopups); } if (!string.IsNullOrEmpty(id)) { builder.SetAccountName(id); } client = builder.Build(); }
private void CreateClient() { // did we log in with a player id already? If so we don't want to ask which account to use var settings = this.activity.GetSharedPreferences ("googleplayservicessettings", FileCreationMode.Private); var id = settings.GetString ("playerid", String.Empty); var builder = new GoogleApiClientBuilder (activity, this, this); builder.AddApi (Android.Gms.Games.GamesClass.Api); builder.AddScope (Android.Gms.Games.GamesClass.ScopeGames); builder.SetGravityForPopups ((int)GravityForPopups); if (ViewForPopups != null) builder.SetViewForPopups (ViewForPopups); if (!string.IsNullOrEmpty (id)) { builder.SetAccountName (id); } client = builder.Build (); }