3

I have a site that allows users to create private content, kind of like a blog post, and then grant access to that content to specific facebook friends. I'm struggling with figuring out how to do invitations to the facebook friends so that the user doesn't have to copy & paste their page URL and manually send it to their friends.

This is the workflow I am trying to implement:

  1. John creates a new blog post on my site by filling out the form and selecting facebook friends who can view it. Susan is one of the selected friends.

  2. John submits the form. My site saves the blog post and generates a unique URL for the new post's page.

  3. John is then presented with Facebook's App Request dialog UI which is populated with the friends he previously selected. John confirms the dialog UI.

  4. Facebook's API takes over from here and sends the App Requests to each friend (including Susan).

  5. Susan launches Facebook from her iPhone (not Facebook.com, but rather the native iPhone facebook app).

  6. Susan sees that she has a new notification in the Facebook app that displays the App Request. She also sees the App Request in her news feed.

  7. Susan clicks the link in the App Request and is taken to the unique URL of the blog post that she was invited to.

Every time John creates a blog post and invites friends, this entire workflow process repeats. So, if John creates 2 blog posts and invites Susan to both of them, then Susan should receive two separate invites each having a unique URL.

I've implemented the App Request UI dialog with this code (from the Facebook JavaScript SDK):

function sendRequestToRecipients() {
   FB.ui({method: 'apprequests',
      message: 'Check out my new blog post',
      to: '499802820,499802852'  //list of selected Friend IDs go here
   }, requestCallback);
}

Now, the pieces that I can't figure out how to get working are these:

  1. When I try to use Facebook's App Request UI dialog, the invitation is only visible if the friend (Susan in the above example) goes to Facebook.com. It's not visible when she opens the Facebook iPhone app.

  2. I can't figure out how to send a unique URL with each App Request. It seems like the App Request UI dialog is designed to just send the URL to my registered facebook web app. For example, if my registered web app's URL is www.example.com, then that's what is used in the App Request. Instead, I need to be able to specify that the URL should be www.example.com/someRandomUniqueID

  3. It's critical that Susan's friends don't see the App Request post. It shouldn't show up as a timeline post or anything like that. Only Susan should be able to see her own App Request.

Is what I am trying to do even possible?

4

0 回答 0