How to implement auto publish to user's facebook timeline just like Instagram? - ios

I am building a social app that user can post into my app. Data stores in our own server and display to iOS native app. I am trying to make the post that user publish to our app to user's facebook timeline. I know that I can post data to my server and then let my app use graph api to publish data directly to facebook timeline. But that will be double post and make the transfer data double which I think might not be a good practise.
So I want to post it to my server first and let server do the rest. Just like shown in facebook docuement
"Auth on Client, API Calls from Server"
https://developers.facebook.com/docs/facebook-login/access-tokens/
But I wonder if this is the case for my app. Because as shown in the diagram "API calls are forwarded to server as a proxy for Facebook API calls" . And this is not the case for my app. Because the API calls will be initiated in the server side when the user use client to post new data.
I wonder how most app implement this.For example ,app such as Instagram and other social app. I am not sure if I do just as I explain will violate any facebook term of usage .
TIA,
Kong

your case perfectly suits the model in the chart.
You said "I am trying to make the post that user publish to our app to user's facebook timeline". I'm assuming you are attempting to mimic instagram since you mentioned it. Let's say user A 'logged-in-by-facebook' on your app and made a post within your app, the app posted to your server (and push back to other users of your Android/iPhone app so they can see, right?). At this time, there's nothing to post to the user's timeline, the scope is in your app only. If the user chooses to post to his Facebook timeline, you take that very same post (which is now saved on your server) and made the call to Graph API and post there, so his friends on FB just see the FB version, not the one within your app.

Related

How To Post Link To Friends Wall Using The Facebook IOS SDK?

I am looking for some advice on the best approach to achieve posting to a users wall from either the IOS App or my server.
Background
My app is currently available and incorporates the Facebook SDK. At the minute there is a custom social network in the app where users can join via Facebook Connect and share their edited photos. The user in the app uploads their photos to my server and then the app will fetch them for other users to see i.e. (latest, categories) etc.
I am looking at creating a web based viewing platform, think instagram where the users can also see their photos.
Goal
At the point of upload from the app I want to be able to post to the users friends on Facebook with a link to the web based image. I am unsure whether or not to send the notification from the app or post it from the server.
Can someone point out what it is that I need to do to achieve the above? I would imagine that I need to ask for extended permissions and then post an open graph notice. Is this correct?

Facebook SDK iOS invite user without FBWebDialogs

I want to get list of my friends from Facebook who are not users of my app, and be able to invite them.
Using FBWebDialogs I can pick users, but I'm wondering how foursquare did it?
Screenshot:
There is option of frictionless requests.
On Facebook developer site they mentioned in section of Invites and Requests
We touched on a scenario where users exchange requests back and forth. If this scenario is typical in your game, it can be a bad user experience to force them through the request dialog every time they want to send a request. The solution for this is frictionless requests.
Frictionless requests let users send requests to friends from an app without having to click on a pop-up confirmation dialog. When sending a request to a friend, a user can authorize the app to send subsequent requests to the same friend without another dialog. This streamlines the process of sharing with friends.
For more reference see Facebook Invites and Requests
You are asking two questions here:
How to invite Facebook friends without web dialogs?
Unfortunately, the web dialogs you are referring to are the best way to send invites to friends. There was a time when we had to resort to ugly hacks just to get this functionality in applications. Facebook added this functionality to iOS SDK after developers created bug reports and were literally behind them.
Get a list of friends who are not using the app and invite them
Foursquare IMO is not using the requests API. What they do is, whenever somebody links their Facebook account to their Foursquare account they make a note of the users friends who are using/not using the app. This is possible if the user grants the app permissions.
Then in the invite screen, they simply build a UITableView with list of friends who they think are not using the app. When you tap Invite they will just send an email invitation and not the Facebook request you are referring to.
I think FourSquare syncing the user's friend list(friend ids) to its own server.. Then after they are checking it to create the custom interface like the screen shot you shared.
Maybe I didn't get the question right, but from what I know after you tap the invite button on Foursquare the Facebook invite dialog (apprequest) will pop up.
In general this dialog will let you select friends if you didn't specify any friends ids before presenting it, or show you the selected friends like in Foursquare example.
There is an API to get your FB friends, so it's possible for your server to check witch of then already has the app...
I've been researching this for a while and the main solution I have found is frictionless requests, as Rahul Patel noted. You can do a direct request to the graph API and see who has your app installed.
From there you could fairly easily implement any sort of filtering. For example, using the Friend Picker UI Control and implementing the method friendPickerViewController:shouldIncludeUser: and checking against a list of facebook ids who are not on the app that you cache somewhere else in your application and actively update it (for example in a simple core data model that is updated when appDidFinishLaunching), returning no if the user is not displayed. This would only allow users to select individuals who are not on the app, and then you could send a request to them under the hood with frictionless requests.
I do think that it is not a great idea to spam people, however, without at least allowing them to check the names of their friends, or see who they are.

Retrieving and displaying third party Facebook statuses in iOS app

I'm new to Facebook development and I'm running into trouble with what seems like it should be an easy task. I am building an iOS app for a client, and that client wants to display a number of their most recent status updates in the app, along with a link to their Facebook page. These statuses should be displayed to the user of the app even if they are not logged into Facebook or do not have a Facebook account saved on their device.
My research so far seems to indicate that I'll need to make a request to the Graph API using a user access token (which I can do successfully in the app using a token copied and pasted from the Graph API Explorer), but it seems that the only way to get a user access token from within the app is to log the user of the app into Facebook using their account credentials. This is not a good solution because I need to be able to display the client's statuses to the user whether they have are logged into a Facebook account or not. Is such a thing possible, and if so, how? I've been all over the docs and can't find a conclusive answer either way.
I know that we would approach it quite differently. We would have our own web service periodically pull what we needed off of google and store it on our own server, then we would use AFHTTPClient to pull this information down to our app. That way we wouldn't have to spoof anything with FaceBook or put any requirments on our users, such as logging into facebook. It would require that you have a service that your client maintains (or you could easily contract that for a cost).

Sharing Facebook access token between iOS and website

I have developed a PHP website where users authenticate via Facebook and I get and store their auth_token.
On the other side, I have started developing an iOS app where users will be able to authenticate via Facebook too. The auth_token, as you know, will be different from the one that I got in the website auth process (same Facebook app as in the website)
My question is: can I use the auth_token that I got in the iOS app to make requests from the website? (same user, same app)
The reason is that sometimes I want some actions to be performed from the mobile device (ie. update status) while others to be performed from the web server (ie. checking which friends of the current user are already registered in my website)
thanks
Essentially, as long as you have a valid access_token for the specific user you can use it anywhere you want. Anywhere that you can execute an http request to Facebook and provide the correct parameters, you'll be able to make API calls on behalf of the user.
https://graph.facebook.com/USER_ID?access_token=XXX
This call should work regardless of where you execute it from.

How to have a FB application create a personalized post to a user

I've read over some of the developer material and have not seen a way to have an application send facebook users personalized wall posts. For example, FB users who likes "Mustangs" could receive a post from my application when there is news specifcally about Mustangs. However, FB users who didn't select Mustangs would not receive the post. Is there a way to do this on the FB platform for applications?
FYI - The only success I have had is sending a post to a user which appears to have been sent from the user as if the user is posting to themselves. Only upon close inspection can one find the text "via application xyz" next to the post time.
Thanks for taking the time to read and respond.
Yes, you can do this with any of the frameworks. See https://developers.facebook.com/docs/sdks/ Also study up on the Graph API (pay attention to the from attribute of a feed item, testing it out using the graph API Exporer: https://developers.facebook.com/tools/explorer

Resources