Exemplo n.º 1
0
        GoogleApiClient buildGoogleApiClient(bool useProfileScope)
        {
            var builder = new GoogleApiClient.Builder(this)
                          .AddConnectionCallbacks(this)
                          .AddOnConnectionFailedListener(this);

            var serverClientId = GetString(Resource.String.server_client_id);

            if (!string.IsNullOrEmpty(serverClientId))
            {
                builder.RequestServerAuthCode(serverClientId, this);
            }

            if (useProfileScope)
            {
                builder.AddApi(PlusClass.API)
                .AddScope(PlusClass.ScopePlusProfile);
            }
            else
            {
                builder.AddApi(PlusClass.API, new PlusClass.PlusOptions.Builder()
                               .AddActivityTypes(MomentUtil.ACTIONS).Build())
                .AddScope(PlusClass.ScopePlusLogin);
            }

            return(builder.Build());
        }
Exemplo n.º 2
0
        GoogleApiClient buildGoogleApiClient (bool useProfileScope)
        {
            var builder = new GoogleApiClient.Builder (this)
                .AddConnectionCallbacks (this)
                .AddOnConnectionFailedListener (this);

            var serverClientId = GetString (Resource.String.server_client_id);

            if (!string.IsNullOrEmpty (serverClientId))
                builder.RequestServerAuthCode (serverClientId, this);

            if (useProfileScope) {
                builder.AddApi (PlusClass.API)
                    .AddScope (PlusClass.ScopePlusProfile);
            } else {
                builder.AddApi (PlusClass.API, new PlusClass.PlusOptions.Builder ()
                    .AddActivityTypes (MomentUtil.ACTIONS).Build ())
                    .AddScope (PlusClass.ScopePlusLogin);
            }

            return builder.Build ();
        }