Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I use FB.ui to post a user story?
    text
    copied!<p>Currently, the below <code>FB.api</code> function is invoked on a click event and posts a user story on the user's timeline (the FB app is in sandbox mode right now and the user story is still pending review):</p> <pre><code>FB.api( // creating the user story '/userid/mynamespace:myaction', 'post', { myobject: fbObjectId, // retrieved in an earlier FB.api call access_token: accessToken, // retrieved in an earlier FB.getLoginStatus call message: customTextFromUser, // prefilled by my app (FB doesn't approve of this) image: ImageURL, // prefilled by my app (FB is OK with this I think) 'fb:explicitly_shared': true // requires that I take the user out of the normal flow of the app which is why I want to show a modal first }, function(response) { // handle the response console.log(response); if (response.id) { alert("Success! The user story has been shared on Facebook!"); } else { alert("Woops! Something went wrong sharing the user story on Facebook. Please try again."); } } ); </code></pre> <p>What I think I need to do is show a modal dialog box such as in the case of when <code>FB.ui</code> is invoked to give the user an opportunity to add a User Message and <em>then</em> post the user story along with the User Message (if any).</p> <p>Will I need to create my own custom modal dialog box or can I use <code>FB.ui</code> in some way to achieve this?</p> <p>Note: The above API call works fine in my tests. Granted, variables such as <code>mynamespace</code>, <code>myobject</code>, and <code>myaction</code> have been obscured in the above code sample. </p> <p><strong>My real problem is the user story is just not being approved by Facebook</strong> because I supposedly need to "take the user out of the normal flow of the app" in order to <a href="https://developers.facebook.com/docs/submission-process/opengraph/guidelines/action-properties/#explicitlyshared" rel="nofollow">Explicitly Share</a> the user story with an additional optional <a href="https://developers.facebook.com/docs/submission-process/opengraph/guidelines/action-properties/#usermessages" rel="nofollow">User Message</a>. I guess I need a strategy to address this issue rather than a specific code sample answer.</p> <p>Here is the latest feedback I got from Facebook:</p> <blockquote> <p>Your action doesn’t follow section IV.2 of the Platform Policies: <a href="https://developers.facebook.com/policy/" rel="nofollow">https://developers.facebook.com/policy/</a>.</p> <p>Words in the user message field must be manually written by the user and can’t be pre-filled by the app, even if the user can edit or delete the words. Learn more about user messages: <a href="https://developers.facebook.com/docs/submission-process/opengraph/guidelines/action-properties/#usermessages" rel="nofollow">https://developers.facebook.com/docs/submission-process/opengraph/guidelines/action-properties/#usermessages</a>.</p> <p>Posting explicitly shared content needs to be optional for users. A sharing control needs to be in-line whenever a user shares something and it can’t be in a separate settings area. The content should have a user-generated component or the user needs to be taken out of the natural flow of the app in order to decide to publish the story back to Facebook. Your current action integration shouldn’t be labeled as “explicitly shared.” Learn more about explicitly shared content: <a href="https://developers.facebook.com/docs/submission-process/opengraph/guidelines/action-properties/#explicitlyshared" rel="nofollow">https://developers.facebook.com/docs/submission-process/opengraph/guidelines/action-properties/#explicitlyshared</a>.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload