Accessing Facebook messages (or notifications) on iOS - swift

I wish to access the user's unread Facebook messages in my app. I'm using the Accounts framework. Calling accountStore.requestAccessToAccountsWithType:options: requires the permissions be given as part of the options.
I want to access /{user-id}/inbox stated in their Graph API. This states that the read_mailbox permission is required. Reading the permissions page, it states:
This permission is granted to apps building a Facebook-branded client
on platforms where Facebook is not already available. For example,
Android and iOS apps will not be approved for this permission. In
addition, Web, Desktop, in-car and TV apps will not be granted this
permission.
In other words: This is available to basically nobody.
After such a blow, I feel like I'm pulling at straws here, but I'm wondering if this applies to the Accounts framework login. Their API references the standard Facebook login (with a button and then a permissions screen) and doesn't mention login through the Accounts framework.
So I tried it, and got an iOS UIAlertView asking if I wanted to allow my app to access the given permissions, including the Inbox permission. I tapped "OK", and was granted access. But then calling accountsWithAccountType: returns 0 accounts (I have a Facebook account logged in on device).
I'm wondering if anyone's done any further investigation, or knows any more about this?

You should first try testing your app in the explorer https://developers.facebook.com/tools/explorer/ and see what comes up.
Additionally, since you have read the permission page, you will understand that it wouldn't make sense developing the app with this feature unless you are the only using it.

Related

Cannot get "public_actions" permission to work on app administrator account

We are currently adding Facebook integration to our product. I have set up our product as an app in the developer portal and have added myself as an administrator of that app. I am logging in to Facebook using the OAuth functionality for devices i.e. I'm posting to the "https://graph.facebook.com/v2.6/device/login" endpoint.
We specifically want to be able to upload videos using our app. I am therefore requesting the "publish_actions" permissions. Everything seems to work i.e. Facebook provides a device authentication code and I am able to poll until the user has accepted the request to add our app and once that is done, I receive back an access token.
The problem I am having is when I attempt to initiate a video upload by posting to the "https://graph-video.facebook.com/v2…/1533641336884006/videos" endpoint, I receive the error 200: "Subject does not have permission to post videos on this target". I can't find any information about what could be causing this in the developer documentation.
I understand that once the app integration is completed, I need to obtain permission to use "publish_actions" to allow it to work with Facebook accounts that are not administrators of the app, however I am trying to upload a video to my Facebook account, which is the administrator of the app.
It is my understanding that as long as you are the app administrator, Facebook does not need to approve "publish_actions" and I should be able to upload a video to my page. Indeed I need to be able to do this in order to complete the integration.
Can you advise on what might be going wrong?
Many thanks,
Damien

Facebook app: How to test unapproved features

Hi I try to make the "publish_actions" feature of my web app approved but I cannot get it approved cause facebook approval system keeps asking me to include screenshot of working features.
However, I cannot provide such screenshot because the "publish_actions" feature is not approved yet.
How is it called? A catch 22 or an Chicken-Egg-dilema? Anyways...
Where should I start?
(I already tried with a test user and a developper account, both in live or developper mode)
Thanks to anyone that can help
You can create test users, or add users as "Testers" or above in your App's "Roles" tab in the developer area of Facebook.
If your app is interacting with a test user or any user with an assigned role in your app, it may request permissions that have not been granted yet by Facebook for public use. There's no trick or workaround; just simply request the permissions like you normally would for any other user.

Test Facebook permissions not yet granted

Is there a way for me to test permissions that are not yet granted to my app by Facebook like the "user_status" permission? I need to test "user_status" for a future app that is not yet in develop since I need to prove that what the client wants is possible.
As long as you are testing with an app admin/tester/developer, everything should work, even if the app didn't pass the facebook Review yet.
See
https://developers.facebook.com/docs/apps/review/login#do-you-need-review
However, in order to help you craft your Facebook Login experience, your app's developers will be able to see, and grant, any permission without requiring review by Facebook.
Note: People who are listed in your app's Roles tab will have access to extended permissions without going through review (e.g. publish_actions or manage_pages). For example, if you use the Facebook Plugin for Wordpress to publish your blog posts to your Facebook Page or Profile, you do not need to submit for review so long as all your publishers are listed in your app's Roles tab.
Also, if you're the developer of an app and are the only person using it, then your app doesn't need to go through review. Since you're the developer, all app capabilities should be available. You will still need to take your app out of developer mode, but you should be able to do that without going through review.

What is needed to access another user's facebook posts ("App Not Setup")

I have a desktop app which uses a user access token to read the me/feed endpoint and I can see all the posts for the logged in user. If I wanted to simplify deployment to different users I would need to minimise the amount of setup/configuration they did.
Is there a way to access me/feed for a given userid rather than have to setup every user as a developer account and create an app for it?
I have looked at https://developers.facebook.com/docs/graph-api/using-graph-api/v2.0 and it is not obvious to me how to do this.
What configuration / permissions does the user in question need to do to activate this. Which access token should I be using, and will it give access to all the posts in the same way the user access token does.
[EDIT] I have looked at this again and the problem I am having is that when a user (who has a facebook account but is NOT a developer) tries to login to my App (which is in development mode) I get the following error
"App Not Setup: The developers of this app have not set up this app properly for Facebook Login."
Thanks in advance

How to limit information requested by my facebook app

I'm using facebook connect to allow the visitors login to a website using their facebook account.
The only information needed is that the user id and name.
However the facebook connect dialog states that my app will access all the users friends, photos...
How can I configure my facebook application to not request those data?
The quick answer, you can't. The dialog states that you have the ability to access the user's information. Whether you access it or not is up to you, but the ability to is always there. There is a base level of access granted to all apps. You can prompt for extended permissions, but you can't customize the base level.
This may change going forward with OpenGraph. There are still features Facebook is adding, and some existing, undocumented features.