开发者

Is post to your wall from android not working?

开发者 https://www.devze.com 2023-03-27 17:53 出处:网络
The code below has worked perfectly for months but over the past couple of days it isn\'t working. Has anyone else had this problem or am I doing something wrong?

The code below has worked perfectly for months but over the past couple of days it isn't working. Has anyone else had this problem or am I doing something wrong?

Button fb1 = (Button) dialog.findViewById(R.id.shareFb);
            fb1.setOnClickListener(new OnClickListener() {

                @Override
                public void onClick(View v) {

                    facebook.authorize(DisplaySaved.this,
                            new String[] { "publish_stream" },
                            new DialogListener() {
                                public void onComplete(Bundle values) {
                                    Bundle parameters = new Bundle();
                                    parameters.putString("message", strChangedStory + ".. " +
                                            "www.X-Appz.com/AppLibs/ShowStory.aspx?storyID=" + xRex + " to read the rest of the story!");
                        开发者_C百科            facebook.dialog(DisplaySaved.this,
                                            "stream.publish", parameters,
                                            this);
                                }

                                @Override
                                public void onFacebookError(
                                        FacebookError error) {
                                }

                                @Override
                                public void onError(DialogError e) {
                                }

                                @Override
                                public void onCancel() {
                                }

                            });
                }

            });
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    facebook.authorizeCallback(requestCode, resultCode, data);
}

Also can anyone tell me once the "share" button has been pressed how can I have it remove the Facebook Dialog screen and return to the previous?


1) Your FB publishing might be broken because FB might have disabled your app - their policies say that "message" should not contain any programmatic feeds, it should only contain user entered statuses. All automated data should go via "attachment". Try going to FB and seeing if your app still exists there.

2) To exit your FB Dialog screen after the user has pressed share or cancel, just add the following code to onComplete -

if (values.isEmpty() || values.containsKey("post_id")) {
            if(values.containsKey("post_id")){
                Toast.makeText(this, "Your content has been Published",
                        Toast.LENGTH_SHORT).show();
            }
            System.out.println("******QFP - going out********");
            finish();
            return;
        }
0

精彩评论

暂无评论...
验证码 换一张
取 消