2014-11-10 15 views
6

Orijinal Sorun

Biraz daha araştırma yaptım, yazının altındaki bilgi görmek. Teşekkürler!Facebook - Eksik metinler

Ben Facebook paylaşım seçeneği ile bir Android uygulaması var. Uygulamanın paylaşım bölümünü çoğunlukla Fb'deki eğiticiden yaptım. Dev. Site, bkz:

https://developers.facebook.com/docs/android/share İşte gerçek kod:

Request.newMeRequest(session, new Request.GraphUserCallback() { 
    @Override 
    public void onCompleted(GraphUser user, Response response) { 
     Bundle postParams = new Bundle(); 
     String name = String.format(getResources().getString(R.string.shareFacebook_title), user.getName(), petName); 
     String caption = String.format(getResources().getString(R.string.shareFacebook_caption)); 
     String description = String.format(getResources().getString(R.string.shareFacebook_description), user.getName(), petName, shelterName); 
     postParams.putString("name", name); 
     postParams.putString("caption", caption); 
     postParams.putString("description", description); 
     postParams.putString("link", getResources().getString(R.string.shareFacebook_url)); 
     postParams.putString("picture", petPicUrl); 

     Request request = new Request(session, "me/feed", postParams, 
       HttpMethod.POST); 

     RequestAsyncTask task = new RequestAsyncTask(request); 
     task.execute(); 
    } 
}).executeAsync(); 

Benim sorundur, paylaşılan bağlantısının tüm metinler yok, ben bundle içine koydu. pic bakınız:

Facebook share

ben app içine debugger ve hata ayıklama, ince postParams koşular tüm çalıştırın ve Bundle tüm metinleri var, ama pay aynı görünüyor (ve yaptığında tüm metinlere sahip olmak).
Bundle, bazı beklenmedik ClassNotFoundExceptions atar, ancak IDE'de bir hata olduğunu düşünüyorum, bkz. Bu SO question.

Debugging in the IDE

eksik metinler tüm telefondan aynı değildir. Bazı telefonlardan resim de çok iyi, ama eminim, URL doğru.

Biliyorum ki, bu 2-3 hafta önce çalıştı ve bugüne kadar hiç kimse bu koda dokunmadı.

Bana yardımcı olabilir misiniz, sorun nedir?
Teşekkürler! Ben Facebook kullanıcısının Graph API Explorer denedim

Düzenleme, aynı sorguyu göndermek ve ben aynı sonucu (eksik metinler, vs.) var. o Graph API kırık/yanlış olduğunu, olası

The same query from the Graph API Explorer

mi: İşte

sorgu var? Geçtiğimiz haftalarda değişti mi? status page, API'nin sağlıklı olduğunu söylüyor.

Düzenleme 2.

Ok, ben eserlerini niteliklerini thoose herhangi bir bağlantıyı paylaşmak istiyorum. Ancak, Google Play'e bir bağlantı paylaşmak istersem, özellikler çalışmaya devam eder. Google FB ayrıştırır, böylece Store, kodda oauth etiketlerini tanımlar oyna o Yerine benim soruna neden bu kullanım Facebook dialoug Muhtemelen

private void publishFeedDialog() { 
    Bundle params = new Bundle(); 
    params.putString("name", "Facebook SDK for Android"); 
    params.putString("caption", "Build great social apps and get more installs."); 
    params.putString("description", "The Facebook SDK for Android makes it easier and faster to develop Facebook integrated Android apps."); 
    params.putString("link", "https://developers.facebook.com/android"); 
    params.putString("picture", "https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png"); 

    WebDialog feedDialog = (
     new WebDialog.FeedDialogBuilder(getActivity(), 
      Session.getActiveSession(), 
      params)) 
     .setOnCompleteListener(new OnCompleteListener() { 

      @Override 
      public void onComplete(Bundle values, 
       FacebookException error) { 
       if (error == null) { 
        // When the story is posted, echo the success 
        // and the post Id. 
        final String postId = values.getString("post_id"); 
        if (postId != null) { 
         Toast.makeText(getActivity(), 
          "Posted story, id: "+postId, 
          Toast.LENGTH_SHORT).show(); 
        } else { 
         // User clicked the Cancel button 
         Toast.makeText(getActivity().getApplicationContext(), 
          "Publish cancelled", 
          Toast.LENGTH_SHORT).show(); 
        } 
       } else if (error instanceof FacebookOperationCanceledException) { 
        // User clicked the "x" button 
        Toast.makeText(getActivity().getApplicationContext(), 
         "Publish cancelled", 
         Toast.LENGTH_SHORT).show(); 
       } else { 
        // Generic, ex: network error 
        Toast.makeText(getActivity().getApplicationContext(), 
         "Error posting story", 
         Toast.LENGTH_SHORT).show(); 
       } 
      } 

     }) 
     .build(); 
    feedDialog.show(); 
} 

cevap

2

ait

0

, o etiketleri yerine benim içeriği.

En iyi çözüm, kullanıcılarımı JavaScript'le yeniden yönlendirdiğim boş bir siteye bağlantı oluşturmaktı.

+0

Teşekkürler, ancak herhangi bir iletişim kutusu göstermek istemedim, postayı kullanıcı etkileşimi olmadan paylaşmak istiyorum. –

+0

oki o zaman shair niyetini kullanabilirsiniz – sukhbir

+0

Bu kod shair niyetinde kullanılan bu facebook yerli uygulaması – sukhbir