2014-11-10 2 views
6

Original Problem

나는 더 많은 조사를했는데, 게시물의 하단에있는 정보를 참조하십시오. 감사!Facebook 공유 - 누락 된 문자

Facebook 공유 옵션이있는 Android 앱이 있습니다. 주로 Fb의 튜토리얼에서 앱의 공유 부분을 수행했습니다. Dev. 사이트를 참조하십시오 :

https://developers.facebook.com/docs/android/share 다음은 실제 코드입니다 :

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(); 

내 문제는, 공유 링크가 모든 텍스트가없는, 내가 bundle에 넣어. 은 PIC를 참조하십시오

Facebook share

나는 응용 프로그램에 디버거, 디버그, 미세 postParams 실행을 모두 실행하고 Bundle 모든 텍스트를 가지고 있지만 점유율은 같은 보이는 (그리고하지 않을 때 모든 본문을 가지고있다).
Bundle은 예기치 않은 ClassNotFoundExceptions을 throw하지만 IDE에서 오류라고 생각합니다 (SO question 참조).

Debugging in the IDE

누락 된 텍스트는 모든 휴대 전화에서 동일하지 않습니다. 일부 휴대 전화에서는 그림이 잘못 표시되지만 URL이 맞다고 확신합니다.

나는 이것이 2 ~ 3 주 전에 작동했으며, 아무도이 코드를 오늘까지 만진 적이 없다는 것을 알고있다.

문제의 원인을 알려주십시오.
감사합니다. 나는 페이스 북의 Graph API Explorer을 시도했습니다

편집, 동일한 쿼리를 보내, 나는 같은 결과 (없는 텍스트 등)를 가지고있다. 이 그래프 API가 고장/잘못된 것을 가능

The same query from the Graph API Explorer

가 : 여기

쿼리입니까? 지난 몇 주 동안 바뀌 었습니까? status page은 API가 정상적으로 작동한다고 말합니다.

편집 # 2

좋아, 그래서 작품 속성 thoose 어떤 링크를 공유하고자합니다. 그러나 Google Play에 대한 링크를 공유하려는 경우 속성이 작동하지 않습니다. 구글은 FB는 구문 분석 있도록 스토어, 코드에서의 OAuth 태그를 정의 플레이 대신 내 문제의 원인이 사용하는 페이스 북 dialoug 아마

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(); 
} 

답변

2

0

, 그 태그 대신 내 콘텐츠.

JavaScript를 사용하여 내 사용자를 리디렉션하는 빈 사이트에 연결하는 것이 가장 좋은 해결책이었습니다.

+0

감사하지만 대화를 표시하고 싶지는 않았지만 사용자 상호 작용없이 소식을 공유하고 싶습니다. –

+0

oki 그러면 shair 의도를 사용할 수 있습니다. – sukhbir

+0

이 코드를 사용하면 shair intent가 facebook 기본 앱과 함께 작동합니다. – sukhbir