示例#1
0
        IGoogleApiClient buildGoogleApiClient(bool useProfileScope)
        {
            var builder = new GoogleApiClientBuilder(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());
        }
示例#2
0
        IGoogleApiClient buildGoogleApiClient(bool useProfileScope) 
        {
            var builder = new GoogleApiClientBuilder (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 ();
        }