2012-02-28 5 views
0

사회화를 사용하여 페이스 북에 내 의견을 공유하려면 어떻게합니까? 다음 코드를 시도했지만 직접 내 의견을 공유하지 않는 페이스 북 홈 페이지에 들어갑니다. 여기어떻게 사교를 사용하여 fb에 내 의견을 공유합니까

public class TraSocializeActivity extends Activity { 
    /** Called when the activity is first created. */ 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     String entityKey  = "http://www.getsocialize.com"; 
     Entity entity = Entity.newInstance(entityKey, "Socialize"); 
     View actionBarWrapped = Socialize.getSocializeUI().showActionBar(this, R.layout.main, entity); 
     setContentView(actionBarWrapped); 

     //this is the code for sharing my comments to facebook but its not working it allows the //user to enter the facebook directly 
     if(Socialize.getSocialize().isAuthenticated()) { 
      //Entity entity1 = Entity.newInstance("http://someurl.com", "My Entity"); 
      String comment = "The comment to be added"; 
      ShareOptions options = new ShareOptions(); 
      options.setShareLocation(true); 
      options.setShareTo(SocialNetwork.FACEBOOK); 
      options.setListener(new SocialNetworkListener() 
      { 
       public void onError(Activity activity, SocialNetwork network, String message, Throwable e) 
       { 
       } 
       public void onBeforePost(Activity activity, SocialNetwork network) 
       { 
       } 
       {       // Handle before post 
       } 
       public void onAfterPost(Activity activity, SocialNetwork network) 
       {       // Handle after post 
       } 
      }); 
      Socialize.getSocialize().addComment(this, entity, comment, options, new CommentAddListener() 
      { 
       public void onError(SocializeException error) { 
        // Handle error 
       } 
       public void onCreate(Comment comment) 
       {       // Handle success 
       } 
      }); 
     } 
    } 
} 
+0

"facebook 홈 페이지에 들어가기"라고 말하면 페이스 북 로그인 페이지가 표시된다는 의미입니까? 그렇다면 이것은 올바른 동작입니다. 사용자는 자신의 Facebook 계정에 앱 액세스 권한을 부여하여 벽에 게시 할 수 있도록 Facebook을 통해 인증해야합니다. –

답변

0

오늘 밤 당신에게 대답을 얻기 위해 우리의 devs ping을거야, 내 코드입니다. 지연 돼서 죄송합니다; 방금 당신의 질문을 보았습니다. - DROdio

관련 문제