所以我很多天都在尝试这个.什么都找不到.
当我尝试使用Facebook Android SDK调用"好友"对话框时,它会返回以下错误:
API错误代码:3
API错误说明:未知方法
错误消息:此显示类型不支持此方法
我没有在文档页面上找到任何东西,告诉触摸设备上不允许朋友对话.我使用以下代码执行此操作:
Bundle params = new Bundle();
params.putString("id", "brent");
Log.i("In on click", params.toString());
SampleDialogListener());
mFacebook.dialog(TestActivity.this, "friends", params, new SampleDialogListener());
如果不允许,是否有其他方式从应用程序中发送朋友请求?
在之前的android SDK中,我通过调用询问了新的权限,Facebook.authorize()并显示了批准权限屏幕.但是在SDK 3.0中,当我调用时FacebookActivity.openSessionForPublish(),对话框总是显示登录表单.如何显示批准权限屏幕?
我已经设置了具有令牌和到期日期的会话,其SessionState是CREATED_TOKEN_LOADED.
是否要求显示权限对话框或Facebook.authorize()始终显示登录表单?那么请教我正确的方法.
我的代码如下
 public class FbConn extends FacebookActivity {
    public void onCreate(Bundle savedInstanceState) {
       ...
       if( savedInstanceState == null ) {
          Session savedSession = CommonUtil.getFbSession(CustomSessionStore.getFbInfo(getApplicationContext())); //get access token and expiration date from session store and set up new session.
          Session.setActiveSession(savedSession); 
          setSession(savedSession);
       }
    }
    protected void onStart() {
       super.onStart();
       openSessionForPublish(EpisodeApplication.config.getSelectedServer().fbAppId, Constants.FB_PERMISSIONS);
    }
 }
更新
我已经注释掉了这些行,并且权限请求屏幕显示成功.但我不确定这是否正确.
在com.facebook.LoginActivity第62行,
Utility.clearFacebookCookies(this);
在com.facebook.Session第1202行,
Utility.clearFacebookCookies(getStaticContext());
在Android项目中试图用一个按钮在Facebook上发布在用户的墙上.单击该按钮时,需要检查用户是否已使用其他Facebook应用程序登录,如果是这样,我需要打开Post On Wall Dialog,并预先填充数据进行共享.请指导我这个来实现.
我尝试按照本教程http://www.integratingstuff.com/2010/10/14/integrating-facebook-into-an-android-application/ 但在网页浏览中要求用户凭据后,页面导航到主要活动,而不是打开墙上对话框上的帖子.提前致谢.
我正在尝试面向Android开发人员的Facebook教程,我在第2步遇到问题- 个性化
我尝试通过键入而不是复制和粘贴教程中的代码来学习,因此我可能输入错误的内容.我似乎无法找到它.
我的profilePicture和用户名没有显示,因为即使我已经授权应用程序,用户似乎也是null.所以我的选择屏幕会显示,但它会显示一个空的用户配置文件.即使在上一个教程中,当我创建一个LoginFragment时,我的用户也没有在那里显示.有什么我做错了吗?
以下是我的完整代码减去import语句和类声明
private static final int SPLASH = 0;
private static final int SELECTION = 1;
private static final int SETTINGS = 2;
private static final int FRAGMENT_COUNT = SETTINGS + 1;
private Fragment[] fragments = new Fragment[FRAGMENT_COUNT];
private static final String FRAGMENT_PREFIX = "fragment";
private static final String TAG = "MyFirstApp_FacebookMain.java";
private boolean isResumed = false;
private boolean restoredFragment = false;
private MenuItem settings;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_facebook_main);
    for(int …我在我的Android应用程序中集成了facebook.使用debugkeytool生成密钥,它在仿真器和真实设备上都能正常工作.
现在我必须发布apk文件,我已经使用eclipse android工具创建了keystore来导出已签名的应用程序包.
使用这个密钥库,我为facebook生成了新的密钥哈希,并将其设置在Facebook开发者网站上.但在使用我自己创建的密钥库签署我的应用程序后,我仍然无法在Facebook墙上发布.我已经检查了创建密钥库的所有步骤,这是正确的.
请帮助我摆脱这种情况.
谢谢
我有这个方法和第一个日志打印,其他没有
我究竟做错了什么?
就是这样:Log.d("insideGetFriends","in"); 获取打印,我查看了我的日志,
Log.d( "facebookError",Integer.toString(graphUsers.size())); 其余的行不会被执行.
 public ArrayList<ParseUser> getFriends(Session session)
    {
        Log.d("insideGetFriends","in");
        final ArrayList<ParseUser> users=new ArrayList<>();
        Request.newMyFriendsRequest(session,new Request.GraphUserListCallback() {
            @Override
            public void onCompleted(List<GraphUser> graphUsers, Response response) {
                Log.d("facebookError",Integer.toString(graphUsers.size()));
                for(GraphUser user:graphUsers)
                {
                    String facebookId=user.getId();
                    Log.d("facebookFriend",facebookId);
                    ParseQuery<ParseUser> query=ParseUser.getQuery();
                    query.whereEqualTo("facebookID",facebookId);
                    query.findInBackground(new FindCallback<ParseUser>() {
                        @Override
                        public void done(List<ParseUser> parseUsers, ParseException e) {
                            users.add(parseUsers.get(0));
                        }
                    });
                }
            }
        });
        return users;
    }
我导出到apk,我安装在手机上.当我点击fb_button时,我收到了这些错误.我试图从eclipse连接到手机,并安装此应用程序.这是工作.所以我不明白问题是什么.请帮我!
我已经为 Facebook 登录实现了自定义按钮,一切都在发生,但我没有收到回电onSuccess,onCancel或者onError我可以得到返回的结果。
我用的是面子书SDK版com.facebook.android:facebook-android-sdk:4.1.0
下面是代码供参考
public class OnBoardingActivity extends AppCompatActivity {
    private final String TAG = OnBoardingActivity.class.getSimpleName();
    private final int TIME_DELAY = 2000;
    private CallbackManager mCallBackManager;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_onboarding);
        FacebookSdk.sdkInitialize(getApplicationContext());
        mCallBackManager = CallbackManager.Factory.create();
 final RelativeLayout facebookSignUp = (RelativeLayout)findViewById(R.id.facebook_signupButton);
        LoginManager.getInstance().registerCallback(mCallBackManager, new FacebookCallback<LoginResult>() {
            @Override
            public void onSuccess(LoginResult loginResult) {
                Log.d(TAG, " Login successfull +++  ");
            }
            @Override
            public void onCancel() {
                Log.d(TAG, " Login …我正在使用相对较新的Facebook图形API.我正在获取使用该应用的朋友列表和他们的个人资料照片.
我不知道如何修改我发送的参数,以便返回的图片很大.当前返回的默认值是小的.
我正在使用newMyFriendsRequest.
我发送它的parms看起来像这样......
Bundle parameters = new Bundle();
parameters.putString("fields", "picture,name");
request.setParameters(parameters);
request.executeAsync();
不知道如何将parm添加到该请求,以便返回给我的图片很大.
有人可以帮忙吗?
以下代码似乎只发布'消息'而没有别的.有什么我想念的吗?(使用Facebook Android SDK)
parameters.putString("link", link);
parameters.putString("description", description);
parameters.putString("caption", caption);
parameters.putString("name", name);
parameters.putString("message", msg);
try {
    String response = mFacebook.request("me/feed", parameters, "POST");
} catch (IOException e) {
    Log.e("Error", e.toString());
}
我收到很多警告,但已经读过这是正常的(同样,我收到了'消息'的警告,但仍然发布:
Key caption expected byte[] but value was a java.lang.String.  The default value <null> was returned.
Attempt to cast generated internal exception:
java.lang.ClassCastException: java.lang.String
我一直在寻找一种方法来做到这一点.但似乎没有什么对我有用.有人可以帮忙这样做吗?
这是我状态帖子的图片按钮:
<ImageButton
    android:id="@+id/imageButton1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignRight="@+id/hoributtons"
    android:layout_alignTop="@+id/imageButton2"
    android:background="#00000000"
    android:contentDescription="@string/facebook"
    android:onClick="shareOnFacebook"
    android:src="@drawable/facebookbutton" />
这是我的mainactivity.java文件的相应部分:
public class MainActivity extends FacebookActivity {
    private static final String APP_ID = "xxxxxxxxxxxxx";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
public void shareOnFacebook(View v) {
        //mfacebook = new Facebook("xxxxxxxxxxxxx");
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}
有人能指出正确的方向吗?:)