Restricting Facebook invite dialog to non-app users? - ios

I am creating an iOS app where the user can invite their friends to use the app using Facebook SDK [FBWebDialogs presentRequestsDialogModallyWithSession:message:title:parameters:handler: method. However, I don't want to show the users that already have the app. I know how to check if a user is an app user or not (using the Graph API, checking the is_app_user field), but how can I make the request dialog to exclude the users that are already users of my app to avoid confusion to the user? Is there any way to achieve this other than the method described here: https://stackoverflow.com/a/18583650/811405?

Related

IOS app that displays a Facebook group

I would like to know what is the best way to show a Facebook group in an iOS app.
I have a iOS app that uses Facebook logins for the users to access content. I thought I might be able to display the a Facebook group using a UIWebView. The problem is when the Facebook group webpage the opened, the user is presented with a login. As the user has already logged into my app using Facebook, I am wondering if its possible to use the current access token to inform Facebook that the user is already logged in.
If that doesn't work, how else could I add a Facebook Group to a iOS app? Is there a sample app somewhere that displays Facebook page is a UIViewController?
Thanks
To the best of my knowledge, if you want to show FB content in a UIWebView, the user must perform the login inside the UIWebView. You cannot share your access token with the web-view.
A possible solution would be to use the graph API (you're already using the FB iOS SDK, right?) to retrieve the group info, feed etc. and show it to your users. The downside is that you'll have to create and display the group info yourself with your own design.
You can take a look at the FB graph API for groups here.

facebook SDK, invite friends

I am developing an app, and users will be able to log in with Facebook. They only can start using the app if a minimum of their Facebook friend are already using the app. If not, they have to wait until the minimum required number of friend use the app in order to use it. I want to allow them to invite their Facebook friends to join.
Also, I would like to know how I can make it happen?
Do I HAVE TO create a facebook canvas or is there any other ways I can make it works?
Thank you for your help.
https://developers.facebook.com/docs/apps/faq#invite_to_app
Games on Canvas: App Request
Other Apps/Games: Send Dialog or Message Dialog
You can't access invitable_friends without enabling facebook canvas in your app's settings, but maybe app requests safisfy your needs? It will list friends (user needs to authorise reading friends list by app) and allow user to send them a notification in their mobile facebook app which will open an app or take user to app's page in App Store if they haven't installed your app yet.
Remember to enable deep linking, facebook SSO and provide App Store ID in platform settings for this work.
https://developers.facebook.com/docs/games/requests/

How do I select friend ids using the facebook api?

Whenever I call FB.ApiRequest() to send invites it brings up a native facebook menu to quickly select friends.
Is there any similar call which would allow me to select friend's user ids in a similar manner/interface like above.
I want to do this so that a user can monitor only selected friend's scores in an app.
This is my first time playing around with the facebook api, and I couldn't find much info about this in fb's documentation.
You just need to call /me/friends after authorizing with the user_friends permission and develop your own selector. Keep in mind that you can only get friends who authorized the App too.

Does Facebook iOS app need to be approved by Facebook?

my iOS app uses the Facebook SDK and users can interact with my iOS app via Facebook. EX. Send friends scores, invites etc etc
I made a new app within the Facebook Developer page, hooked everything up and it works just fine. I turned off sandbox mode within Facebook and I submitted my app the other day to Apple. Today, I noticed there is also a submit app for Facebook.
Am I required to have Facebook approve my iOS app in order to use Facebook services in my iOS app or is this only if I want my iOS app to show up in Facebook App Center?
Thanks!
When you registered your app to facebook.
Facebook provide only three permisson , these permission is by default approved
email
Provides access to the person's primary email address. This permission is approved by default.
public_profile
Provides access to a person's basic information, including first name, last name, profile picture, gender and age range. This permission is approved by default.
user_friends
Provides access to a person's list of friends that also use your app. This permission is approved by default.
If you want to use more feature apart from them , then you need to submit your app to facebook for use other feature
like if want to get user photo then you have to submit your app for get user_photo permission
facebook check that how you are using user_photo in your app
And you also need to upload screen shot with submission that show you are using facebook photo
To submit an app using Facebook services, even the integrated Facebook system account you don't need to do anything special, only apple has to approve your app, off course Facebook has their rules, and if you don't respect them, they can decide to turn off some services that your app doesn't respect

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.

Resources