Can I publish open graph story in background? - android

I have android application.
I need to post messages to FB on some user actions.
As I understand from brief documentation read:
I can do it without specific permissions but using FB share popup. User should type some message here
I can publish open graph stories in background. But I need publish_actions permission for that. Also need some confirm popup before publish so that user to be aware of this. But I can set messages I need without ability for user to change text.
Are my assumptions correct?

Related

How to share image from my app on Facebook

I want to allow users to share image from my app on Facebook. Say I already have an image (i.e. file path). How do I go about letting a user share it on Facebook? Basically I want the user to agree once. Then from there on, whenever the user takes a certain action in my app, share a particular image on Facebook on behave of the user. Notice that the image is to be shared automatically without the user having to take action each time; so the Facebook sharing is incidental to some other action in my app. I am looking at the Facebook documentations. It is not clear which path to take to accomplish what I need. So thanks for any guidance.
Again, the user agrees once and goes on her merry way. Then the app, each time a user takes a certain action, share an image on Facebook.
UPDATE
Here is the path I have identified for sharing a photo on behalf of a user
Setting up your app to use Open Graph
Creating an Open Graph Story
Posting with API calls
The problem with this approach is that, at least in the sample project, the user has to click on Share each time. But I don't want the user to have to click on share each time. I want them to give me permission once. And then from there the app shares for them automatically.
Trial and error is expensive here as it is a lot to implement just to see if it were what I was looking to do: Which is why I am asking here, hoping someone here has done this in the past and don't mind sharing their experience.
You should ask the user for the publish_actions permission, and then use Request.newUploadPhotoRequest to publish a photo. https://developers.facebook.com/docs/reference/android/current/class/Request/#newUploadPhotoRequest
You need uses-permission Facebook, try this; https://developers.facebook.com/docs/android/getting-started
After you do this, you need to take method onClick and send the picture directly for facebook, but for this, is necessary the login of user's.

Alternate Publish Actions for Submitting a Facebook HighScore?

I'd like to submit a simple highscore onto the Facebook Open Graph and I'm doing it through Unity/Facebook SDK for Android. I'm using the built in:
FB.API("/me/scores", Facebook.HttpMethod.POST etc**.....
Everything is working.
However, I'm really unhappy that I need to request publish_actions permissions, in order to submit a score. (I'm requesting these permissions on login).
Reason:
It pops out 2 dialogues. One for accessing public profile, & then a "Post to your friends on your behalf.
I tested my app on my sister, and witnessed her instinctively declining the 2nd Dialogue :"Post to your friends on your behalf"..
So basically, majority of people will not be submitting highscores, simply because they decline the misleading "Post to your friends on your behalf" request. when I simply want to submit a number >.<
Which defeats the purpose of my whole app, which is friends/social highscore based.
Does anyone know any alternative strategies to submit highscores onto Facebook Open Graph in a more "friendlier" manner?
Would be much appreciated!!!
You can't do anything regarding this- this is by design.
Try to understand- if facebook dont show this dialog, then apps can publish spam etc. on the user's wall unnecessarily. So, in order to save the spamming etc. this dialog appears so that user can "choose", whether he wants to allow the app to publish on his behalf or not. This is necessary, hope it makes sense for you!

Posting with DENY privacy not working (And how to save privacy)

My android app posts a status with deny privacy for some friends (who cannot see), but it's not working. Here's my Graph API call:
POST me/feed?message=this is message &privacy='value':'CUSTOM','deny':'friend_1_id,friend2_id'}`
However, it's working with allow privacy like this:
POST me/feed?message=this is message &privacy='value':'CUSTOM','allow':'friend_1_id,friend2_id'}
How can I do with DENY to achieve my goal without using ALLOW?
(Important) How can I setting this custom privacy into user's facebook?
Because I want Facebook app to keep this privacy (user does not need to change the setting again when using original facebook app).
Note: My app works with Facebook SDK 3.8
How can I do with `DENY` to achieve my goal without using `ALLOW`
According to the facebook developers [src]: This is by design. When you use CUSTOM privacy, you should specify the allow field, or by default you'll be the only person that will be able to view this post.
So instead of:
POST me/feed?message=test&privacy={'value':'CUSTOM','deny':'[FRIEND_ID]'}
you should do:
POST me/feed?message=test&privacy={'value':'CUSTOM', 'deny':'[FRIEND_ID]', 'allow':'ALL_FRIENDS'}
(Important) How can I setting this custom privacy into user's facebook?
You cannot ever set anything that is part of the user settings, from the Graph API. This is strictly not allowed by the facebook.

Integrating Facebook into android - login permissions

I am in the process of integrating Facebook login into the android app I am developing.
I would like the app to be authorised to post/publish to feed/timeline. At present the user is receiving two login permissions screens (One for the initial login and a second one is appearing for the post permission). This isn't an ideal user experience.
How do I incorporate the permission to post into the permission screen that appears when the app asks the user to login to Facebook.
Having done some research it appears other apps can gain the authentication at the point of login and not require a re-login permission screen to appear with the post permission included.
I'm clearly missing something.
Please help!
Thanks.
Possible copy of: Facebook SSO for Android can I ask for login and permission all in one time
Bottom line is: "With the new SDK, you are required to ask for write permissions (such as "publish_actions") separately from read permissions".
As you said it isn't an ideal user experience, I used a similar way to implement the login a user using sdk facebook, I follow this tutorial and it should show to the user only one login, and then a screen showing the post permission, without having to make log in again.
this

Facebook basic user information

I would like to display some information about the user before using SSO. Something like:
"Login with facebook as John Smith"
Is this possible before actually logging in? Like grabbing info from the facebook app?
It'd be nice to express to the user that pressing the button means logging in with the user defined in the fbook app. I just don't want my users thinking they'll get to input an email address and accidentally link their account to their friend's facebook.
The reason for why this is not possible is that if it would be possible you could easily track who exactly is using your app, without having the permission to collect that user information.

Categories

Resources