简体   繁体   English

Android Facebook集成在线朋友并发送收件箱消息

[英]android facebook integration online friend and send inbox message

I integrated the Facebook in my Android application and I use this code to get the friends: 我将Facebook集成到我的Android应用程序中,并使用以下代码来获得朋友:

try {

  Facebook mFacebook = new Facebook(Constants.FB_APP_ID);
  AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook);
  Bundle bundle = new Bundle();
  bundle.putString("fields", "birthday");
  mFacebook.request("me/friends", bundle);

}catch(Exception e){
  Log.e(Constants.LOGTAG, " " + CLASSTAG + " Exception = "+e.getMessage());
}

Is there a way to get the online friends? 有没有办法结识在线朋友?

And I post to walls of friends with this method: 然后我用这种方法贴在朋友的墙上:

    Bundle parameters = new Bundle();
    parameters.putString("message", message);
    parameters.putString("description", "integrating stuff");
    try {
        facebook.request("me");
        String response = facebook.request("me/feed", parameters, "POST");
        Log.d("Tests", "got response: " + response);
        if (response == null || response.equals("") ||
            response.equals("false")) {
            showToast("Blank response.");
        }
        else {
            showToast("Message posted to your facebook wall!");
        }
    finish();
    } catch (Exception e) {
        showToast("Failed to post to wall!");
        e.printStackTrace();
        finish();
    }

Is there a way to send message to friends' inbox, and not post in the wall? 有没有一种方法可以将消息发送到朋友的收件箱中,而不是贴在墙上?

You get online friends if you are Facebook chat clients which is very different thing. 如果您是Facebook聊天客户端,您会获得在线朋友,这是完全不同的事情。 Till now you cannot send private message there is send dialog but I didn't try to use it before 到目前为止,您无法发送私人消息,但有发送对话框,但是我之前从未尝试使用它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM