Alternative to Facebook read_stream - ruby-on-rails

Is there an alternative to allowing the permissions of some sort rather then 'read_stream' permission in Facebook, for a user to read or an app pull their Facebook feed or home feed?
It's very hard, if at all, for Facebook to approve the 'read_stream' permission, so I'm looking for an alternative steps to still allow for our users to pull their favorite stories in our rails app. Any suggestions?

There is no alternative. You can use user_status to get the status posts of the authorized user with /me/statuses.
Btw, it´s not only "hard" to get read_stream approved, it´s nearly impossible ;) - but for very good reasons. Apps should not get access to posts of users who did not even authorize the App.
edit: There is also user_posts now, as replacement for read_stream: https://developers.facebook.com/docs/apps/changelog#v2_3_new_features

Did some investigation. And it is possible.
Instead of the feed you need to access the endpoint /me/posts
This API is accessible with either read_stream or user_posts permission.
https://developers.facebook.com/docs/facebook-login/permissions/v2.3#reference-user_posts
See here for more information:
https://developers.facebook.com/docs/graph-api/reference/v2.3/user/feed
It is quite hidden, but if you know where to look you can find the docs.

Related

Can I get a user's display name from Apple MusicKit?

I've been going through Apple's (awful) documentation for both MusicKit, the API and MusicKit JS, but I haven't been able to find an endpoint or method to retrieve a user's display name, email or any other information that I can use to identify the user.
Is there even a way to retrieve this?
I've been having the same issues as well. As far as I can tell, there is no way to identify the user. I'm getting around this by just giving users temporary sessions that get destroyed when they clear their cookies or unauthorize from musickit.
On the other hand, you could ask the user to log in with some other auth provider like google, github etc, and then authorize their apple music after that. Its's not the best user experience to log in to two things in a row, but I guess we have to make do

Facebook app permissions

I have an iOS app which posts to Facebook on behalf of the user logged in through the iOS Facebook setting.
Two problems -
the posts are marked private, the users friends don't see them.
The iOS app want to be able to harvest Like and Comment info but I get back a 400 from FB.
Here's the wrinkle, my Facebook account works perfectly (posts are visible to friends and I can get the Like and Comment info), but a test user account will post only as private and the iOS app gets a 400 when trying to get post info.
The attached screen shots show the different permissions (top for tester, bottom for me) but I can figure out what to ask Facebook for at login to get the same permissions for both users. Currently I'm asking for publish_actions and user_status.
Any help would be much appreciated!
You need to make sure you are asking for public_profile also you need to make sure you split your permission access into two pieces, as per FB, 1) read 2) write
Just follow the login process on the Facebook Dev page, this will allow you to outline your permissions the right way. Also make sure your test user is added into the groups on your Facebook Dev portal.
Also can you provide any code of what you have tried?
Turns out the post_id element was not what I wanted but rather the id. After that I could use json to get the comments and likes. So the call was almost correct.
And adding stream_read to the permissions got the post to be visible to friends...
Thanks for all the help!

Mention Facebook Page

I am using Koala to post on my Facebook wall and I would like to mention a page. But the following doesn't work:
#graph.put_wall_post("This page rocks: #[1466840030227949]")
Any way to do this with Koala? And without Koala?
I know this is old, but this answer may help someone else who ends up here.
the syntax above is correct with Koala. To mention a Facebook Page you need to include #[page-id] in the message parameter.
To use Page Mentioning with any Facebook Page, your app need to have been granted the manage_pages and publish_actions permissions. Your app will also need approval for the Page Mention feature.
There is a way to test this without being approved for the permission or feature but please check out my related question and the Facebook docs for more information on how to do that.

How to programmatically change Facebook posts visibility to "public" on iOS

Would like to change the default visibility of app and posts in Facebook from "Friends" to "Public" programmatically on iOS. Is there any example code for this? Thanks a lot in advance.
You can set defaultAudience Property .
Most applications use FBSessionDefaultAudienceNone here, only specifying an audience when using reauthorize to request publish permissions.
There are other option to set is,
FBSessionDefaultAudienceNone:
No audience needed; this value is useful for cases where data will only be read from Facebook.
FBSessionDefaultAudienceOnlyMe:
Indicates that only the user is able to see posts made by the application.
FBSessionDefaultAudienceFriends:
Indicates that the user's friends are able to see posts made by the application.
FBSessionDefaultAudienceEveryone:
Indicates that all Facebook users are able to see posts made by the application.
It appears from here and here that you can setup the privacy of the post at creation time, but you cannot edit it.
Also, per facebook's developer TOS and Privacy Policy, unless what you are doing [changing the default privacy of a post] is specifically authorized each time by the user, it'd be breaking terms of service and immediately get your app shut down. Facebook takes privacy very, very seriously.

In rails, how can I import a user's facebook contacts when they sign up?

I have a signup form, and I wanted to make it so that they have the option of recommending this signup to all their friends in facebook.
Is there a rails API/gem for doing this?
Is there an appropriate name for this?
Thanks!
Looking at the Extended permissions documentation, you don't get access to the email addresses of a Facebook user's friends (search for email and note the second column reads not available). If that's what you're trying to achieve, it's almost certainly not possible, without the user contacting each friend and asking them to visit your app (which I would imagine would have quite a low take-up, if only through inertia).
I guess you have two options:
popup a javascript before submitting the form to prompt the user wether he wants to share it with friends. You will use the js api http://github.com/facebook/connect-js (see the dialog section). This solution would avoid doing server side connection to the facebook api
Have a look a the Facebooker gem to do a stream_publish

Resources