WordPress.org

Ready to get started?Download WordPress

Forums

WPBook
[resolved] Configuration of WP -> FB Group; Tabs? (18 posts)

  1. erinspice
    Member
    Posted 2 years ago #

    Hello! I am excited to have found out about WPBook Lite (no ssl here) and the prospect of being able to push my WP posts to our Facebook group wall automatically. I have followed all the instructions, but am getting an error when I publish: "No post id returned from Facebook, $fb_response was /n and $fb_page_type was and $wpbook_description was <my post>". I'm using WPBook Lite 1.2.6.

    Here's what my config looks like:

    Facebook App ID: Set correctly
    Facebook App Secret: Set correctly
    YOUR Facebook Profile ID: Set correctly
    Stored access token: done and displays correctly in WPBook Lite config
    (my Facebook profile is the group admin and all group members can post to the wall)
    Publish new posts to the wall of this page/group is checked and group id is set. page ID is blank. Is this correct, since it's a group and not a page?
    Publish as Posts is selected
    import comments is selected
    automatically approve comments is selected
    show Facebook avatars is selected.

    In my Facebook app config, I have App Display Name, App namespace, email, site URL is the URL of WordPress without index.php with trailing slash, canvas URL is the same as site URL, page tab name is set, page tab URL is my WordPress link with index.php?app_tab=true.

    What is the page tab config? If this is Facebook tabs, my group doesn't have any tabs, I just want the posts to go on the group wall.

    Thanks for the help, I can't wait to get this set up!

    http://wordpress.org/extend/plugins/wpbook/

  2. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    Tab config you can ignore- it's for page tabs.

    Did you make your Facebook Application recently? (is it a new one, not an existing one from before)?

    If so, check the "Advanced" tab for settings (in Facebook, developer app where you set settings for the apps you've made) and migrations.

    You need to ensure that "Deprecate offline_access" is set to "disabled" - WPBook and WPBook Lite both need offline_access to work.

    After changing that, you will need to re-generate an access_token to get the right permissions.

    If you check the "Show errors in publishing to Facebook stream" in WPBook Lite settings, you should get a more descriptive error message as well.

  3. erinspice
    Member
    Posted 2 years ago #

    Thanks, I deleted the page tab configuration. It is a new Facebook app, but I had seen that about deprecate offline_access (and also Enhanced Auth Dialog) elsewhere, so I had already disabled those. I attempted to regenerate the access token anyway but clicking Generate Access Token again did not change the saved access token. It said it had been saved, but didn't update the page. I also tried with and without enhanced auth dialog, since it was indicated in the post I read that it wasn't certain it was a problem. In all cases, after enabling errors, I get "Caught exception publishing to group as Post: An unexpected error has occurred. Please retry your request later.Error code: 0." Thanks for the help.

  4. erinspice
    Member
    Posted 2 years ago #

    When I visit my app's facebook page, it shows my entire WP site in a frame, theme and all. Is this indicative of a misconfigured URL or something like that?

    Also, I am looking at instructions on this page: http://wpbook.net/docs/wpbook-lite-install-instructions/wpbook-lite-basic-settings/ and under "D. Fill out Basic Plugin Settings", it says to fill out the "Facebook Canvas Page URL", which is not present in my WPBook Lite Settings.

  5. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    Are you using WPBook, or WPBook Lite?

    WPBook Lite should not have a canvas page at all - that's why it doesn't require https.

    In your facebook application settings, you should only fill out the "website" tab, not the "application on facebook" tab for WPBook Lite

  6. erinspice
    Member
    Posted 2 years ago #

    I am using WPBook Lite, and the link above where that is mentioned specifically references WPBook Lite. I removed "App on Facebook" settings and am still experiencing the same behavior: "Caught exception publishing to group as Post: An unexpected error has occurred. Please retry your request later.Error code: 0"

  7. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    @erinspice thanks for clarifying - I was just asking about WPBook versus Lite in terms of trying to visit the canvas page.

    Still trying to narrow down why the error is happening - Facebook's API is returning an error but obviously it isn't a very useful one.

    Can you take the access token stored (which you can find on the WPBook Lite settings page) and check it here:

    https://developers.facebook.com/tools/debug/access_token/

    That should tell you whether the access token is valid for your user.

    I'm sure you've checked it, but can you validate that the group ID is the correct ID? (Easiest way is to visit graph.facebok.com/id)

    You could actually do a test here:
    http://developers.facebook.com/tools/explorer/

    Using your access token, and trying to post to graph.facebook.com/groupid/feed/

    with some name value pairs - but I know that's kind of tricky to do. (The possible fields in that post are defined here: http://developers.facebook.com/docs/reference/api/group/ )

    Shorter, easier troubleshooting - try posting to your own profile first, just to validate that works, then try posting to a new test group that is public, etc.

  8. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    Oh, also, if you check your access_token at the url I provided, ensure that it has the right AppID and name (in the results displayed), profile iD and name, and tell me what "scopes" it has.

    Mine shows:

    Issued: 1277052611 : 9:50 am Jun 20 2010
    Expires: Never
    Valid: True
    Origin: Unknown
    Scopes: create_note offline_access photo_upload publish_stream read_stream share_item status_update video_upload

  9. erinspice
    Member
    Posted 2 years ago #

    My token has the right app id and profile id (mine) and:
    Issued: 1331143173 : 9:59 am Mar 7 2012
    Expires: Never
    Valid: True
    Origin: Web
    Scopes: create_note manage_pages offline_access photo_upload publish_stream read_stream share_item status_update video_upload

    graph.facebook.com/$group_id shows all the right stuff.

    I did the test (POSTing to http://graph.facebook.com/78205250/feed with message and link set) and it worked fine, sending back JSON with an id constructed of my profile id, _, then post id.

    Posting to my own timeline worked just fine.

  10. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for doing such extensive debugging work!

    When you did the test, were you publishing to the ID you post above? If so, that's not a group that's an individual profile.

    If you do the same test but use graph.facebook.com/group/feed substituting the *group* ID does that work?

    If you create a test group and try publishing to that test group?

    All the scopes look right - offline_access and publish_stream I think are the only ones needed here - so it has to be something specific about the group.

    Can you share what group it is, or create a test group and share what that one is if you don't want to share the other one?

  11. erinspice
    Member
    Posted 2 years ago #

    That previous POST test using the Graph API Explorer was also to my own profile. I tested it using the group ID and got:

    {
    "error": {
    "message": "An unexpected error has occurred. Please retry your request later.",
    "type": "OAuthException",
    "code": 2
    }
    }

    Which is different than the error I get when posting from WPBook Lite.

  12. erinspice
    Member
    Posted 2 years ago #

    Whoops, cross-post. Great minds think alike.

    I'm a developer, too. :) Debugging is part of the job!

  13. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    Well, to a software engineer getting a different error message is some kind of progress. ;)

    Not sure error code 2 is any more meaningul than error code 0 though.

    But it is interesting the Graph API explorer post also fails with some kind of OAuth issue.

    I wonder if FB has yet again introduced some new permission needed to post to groups - before you just needed the right to publish as the person and offline access.

  14. erinspice
    Member
    Posted 2 years ago #

    API docs also say only the publish_stream permission is required.
    https://developers.facebook.com/docs/reference/api/group/

  15. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    There is another permission described here: http://developers.facebook.com/docs/reference/api/group/

    For a user's non-public groups, the app needs "user_groups" permission in the access token to read the group.

    But to post it just says publish_stream is required - but maybe the implication is for a non-open group you need user_groups also?

    When you click on "Generate Access Token" from the WPBook Lite settings page, the url is essentially this:

    https://www.facebook.com/dialog/oauth?client_id=[appid]&redirect_uri=[bloghomepage]/%3Fwpbook=oauth&scope=read_stream,offline_access,publish_stream,manage_pages

    You could test by just adding user_groups to the end of that comma delimited list of permissions being requested - just copy the url out of the WPBook Lite settings page, paste it into your browser window in a new tab, and add ,user_groups to the end.

    That should generate and save a new access token, which you can then check in the debugger url at Facebook I pointed to above - you should now have user_groups in the scopes list.

    Then you could retest in the Graph API Explorer with that new Access Token, or even just test directly in WPBook Lite.

    I will try at some point to set up a test private group and try this myself but it might not be for a few days

  16. erinspice
    Member
    Posted 2 years ago #

    Success! That worked. Thanks very much!

  17. johneckman
    Member
    Plugin Author

    Posted 2 years ago #

    Ok, so I need to update the plugin to ask for user_groups permission as well - thank you for working through it!

    Will be in the next release, though that shouldn't impact you since you've already got an access_token with the right permission

  18. erinspice
    Member
    Posted 2 years ago #

    Yep, I'm good!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags