Letting user specify recipients within Feed Dialog

前端 未结 1 1667
说谎
说谎 2021-02-11 04:11

Currently, our app posts to users\' friends\' walls via Graph API. However, Facebook is deprecating this functionality so we are migrating to the Feed Dialog per Facebook\'s rec

1条回答
  •  南笙
    南笙 (楼主)
    2021-02-11 04:47

    OK, we found a workaround. The general idea:

    1. Display the Feed Dialog inline as an iframe (by specifying display=iframe)
    2. Create your own custom control for selecting a recipient Facebook username or id
    3. Reload the iframe asynchronously upon selecting a recipient or onblur, etc

    Some caveats/reasoning for above:

    • You can't use the JS SDK because it will launch the iframe version of the Feed Dialog as a modal lightbox (rather than inline in your page flow)
    • You'll need to implement a redirect page that does post processing, such as updating the state of the parent window, logging results, etc
    • For (2), the custom control can be as simple as a text input field, but you'll probably want at least some sort of autocomplete. This is actually not too tricky, as you grab your user's friend list with the https://graph.facebook.com/me/friends Graph API call.

    Here's a basic example using a simple text input:

    
    
    
    
    
    
    Recipient's FB username:

    You can find a screenshot of a slightly more fleshed out solution at: http://i.imgur.com/0jTM391.png

    0 讨论(0)
提交回复
热议问题