Exemple #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.Login);
            mGoogleSignIn = FindViewById <SignInButton>(Resource.Id.sign_in_button);


            mGoogleSignIn.Click += mGoogleSignIn_Click;

            GoogleApiClientBuilder builder = new GoogleApiClientBuilder(this);

            builder.AddConnectionCallbacks(this);
            builder.AddOnConnectionFailedListener(this);
            builder.AddApi(PlusClass.Api);
            builder.AddScope(PlusClass.ScopePlusProfile);
            builder.AddScope(PlusClass.ScopePlusLogin);

            //Build our IGoogleApiClient
            mGoogleApiClient = builder.Build();
        }
Exemple #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Login);

            strCooperativa = Intent.GetStringExtra(clsConstantes.strCooperativas);

            mGoogleSingIn = FindViewById <SignInButton>(Resource.Id.sign_in_button);

            mGoogleSingIn.Click += mGoogleSignIn_Click;

            GoogleApiClientBuilder builder = new GoogleApiClientBuilder(this);

            builder.AddConnectionCallbacks(this);
            builder.AddOnConnectionFailedListener(this);
            builder.AddApi(PlusClass.API);
            builder.AddScope(PlusClass.ScopePlusProfile);
            builder.AddScope(PlusClass.ScopePlusLogin);

            mGoogleApiClient = builder.Build();
        }
        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();
        }
Exemple #4
0
        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 ();
		}