2014-11-28 21 views
5

öğesini döndürüyor. Şu anda uygulamanızda Google Plus oturum açma özelliği üzerinde çalışıyorum. Plus.PeopleApi.getCurrentPerson, null

aşağıda

Plus.PlusOptions options = new Plus.PlusOptions.Builder() 
      .addActivityTypes("http://schemas.google.com/AddActivity") 
      .build(); 

    myGoogleApiClient = new GoogleApiClient.Builder(this) 
      .addConnectionCallbacks(this) 
      .addOnConnectionFailedListener(this) 
      // .addApi(Plus.API, Plus.PlusOptions.builder().build()) 
      .addApi(Plus.API, options) 
      .addScope(Plus.SCOPE_PLUS_LOGIN) 
      .addScope(Plus.SCOPE_PLUS_PROFILE).build(); 

gibi GoogleApiClient kurucu ve onConnected yöntemi oluşturuldu

@Override 
public void onConnected(Bundle arg0) { 
    // TODO Auto-generated method stub 

    plusUtilities.ShowToast("Login successful"); 

    updateGPbutton(); 
    // hide progress DiaLog 
    plusUtilities.DissmissPD(); 
    // it has deprecated 
    // plusUtilities.ShowToast("Login to Google+ with " + 
    // mPlusClient.getAccountName().toString()); 

    // upgraded class 
    plusUtilities.ShowToast("Login to Google+ with " 
      + Plus.AccountApi.getAccountName(myGoogleApiClient).toString()); 

    // deprecated 
    // mPlusClient.loadPeople(this, "me"); 

    Plus.PeopleApi.load(myGoogleApiClient, "me"); 
    // plusUtilities.ShowPD("Fetching user data... "); 

    // upgraded and call fetch_user_details method here instead of calling 
    // in onPersonLoad() override method 
    Log.d("Googleplusclient", 
      "" + Plus.PeopleApi.getCurrentPerson(myGoogleApiClient)); 
    Plus.PeopleApi.loadVisible(myGoogleApiClient, null).setResultCallback(this); 

    if (Plus.PeopleApi.getCurrentPerson(myGoogleApiClient) != null) { 
     Person currentPerson = Plus.PeopleApi 
       .getCurrentPerson(myGoogleApiClient); 
     fetch_User_Details(currentPerson); 
    } 

} 

aşağıdaki yöntem null

Plus.PeopleApi.getCurrentPerson (myGoogleApiClient)

I döndürür the link fo takip etti Çözelti Daha sonra bu developer link'u takip ettim. Boş değere ulaşana kadar.

Bu nasıl çözülür?

cevap

12

Sorun şu ki, DEBUG sha1 imzanız farklıdır, ardından customkey.keystore sha1 imzanız !! böylece hata ayıklama sha1 imzasını bulmalı ve bu anahtarı Google konsolu ASWELL'de API kimlik bilgileri üzerinde oluşturmalısınız! : D bu işe yarıyor ve düzeltiyor bana güven, api konsolunu kontrol et ve bahse girdin api istekleriniz 0 mı?

+1

customkey.keystore sha1 imzası ile ne demek istiyorsun? ? – tranquil

+1

@tranquil - bu, sürümünüzü piyasaya sürmek için kullanmanız gereken .keystore sürümünüzdür. –

İlgili konular