iOS: Facebook Posting Privacy - iphone

Does anyone know why when I post a status / message to the current authenticated user in my app, the default privacy that appears is "Only Me" in facebook? I've read and tried their API reference including this: http://developers.facebook.com/docs/reference/api/post/ but my app just stop working. Why is this so?
This is my code to post the user's status(pre-generated):
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
appId, #"app_id",
#"Event Invitation", #"name",
#"Event Invitation", #"caption",
eventInvitationText, #"description",
eventInvitationLink, #"link",
#"http://fbrell.com/f8.jpg", #"picture",
nil];
[self.facebook dialog:#"feed" andParams:params andDelegate:self];
Referring to the link, I had also added the:
#"EVERYONE", #"privacy"
as one of its parameter for privacy but when I add it, the fb dialog will just say that there is an error in my app.
Can you help me guys? thanks in advance..

The user can choose a maximum visibility setting for your app when authorising it to post on their behalf in the auth dialog.- your app can't choose a privacy setting more open than whatever the user chose there
(Nor can your app prompt them to increase the settings but they can change it themselves in Privacy Settings - Apps, Games & Websites on their Facebook profile)

Related

Workaround to Post in a friend wall after Graph API feature is deprecated

My iOS app is trying to post to a friend's timeline. I was using the Graph API, but it's seems from what I read at Platform Updates: Operation Developer Love of February that is now deprecated and you can't post on a friends wall using that. Without this feature the social part of my app will be very weak. So, I did some research and found that using some deprecated headers you still can publish on a friends feed (http://developers.facebook.com/docs/howtos/publish-to-feed-ios-sdk/). After doing all the code, I'm just missing a small part that I can't found anywhere that is how can I set a default text to this Facebook Dialog? Or if someone has another way to do it without using these deprecated stuff please share...
Thanks
// Put together the dialog parameters
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
friendID,#"to",
#"Facebook SDK for iOS", #"name",
#"Build great social apps and get more installs.", #"caption",
#"The Facebook SDK for iOS makes it easier and faster to develop Facebook integrated iOS apps.", #"description",
#"https://developers.facebook.com/ios", #"link",
#"https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png", #"picture",
nil];
// Invoke the dialog
[self.facebook dialog:#"feed" andParams:params andDelegate:self];

Facebook Connect Post Dialog Text?

HI I have got Facebook Connect working with a functional login and logout button. Also when I press a button I want to post to Facebook. I can do this, kind of. You see, I have a specified string that the user customizes before hand, it is called statusUpdates. I am not sure how to do this. Here is my current code for opening the dialog to post on Facebook.
I have tried this:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"http://developers.facebook.com/docs/reference/dialogs/", #"link",
#"http://fbrell.com/f8.jpg", #"picture",
#"Facebook Dialogs", #"name",
#"Reference Documentation", #"caption",
#"Dialogs provide a simple, consistent interface for apps to interact with users.",
#"description",
#"Facebook Dialogs are so easy!", #"message",
nil];
in an IBAction where statusDefaults is a valid NSString. Now I already have statusDefaults, the string I want to put on the initial Facebook dialog text because right now when it opens it is totally empty. How do I do this, what should I modify?
actually thats not possible , i faced the same problem and i found this in Facebook documentation
This field are intended for users to express themselves. Pre-filling this field erodes the authenticity of the user voice.

iOS Facebook Request Dialog Not Working

I am following the Facebook iOS tutorial. I'm trying to implement their code:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"Come check out my app.", #"message",
nil];
[facebook dialog:#"apprequests"
andParams:params
andDelegate:self];
The dialog appears, I add my friends, then I click "Send". At this point nothing appears to happen. My friends (test accounts) never receive the notification.
This delegate method is called:
-(void)dialogDidComplete:(FBDialog *)dialog
{
}
Any ideas as to why my friends aren't receiving the notifications?
In essence, what I am trying to do is get people to share this app with their friends. They click on the link and it opens the app in the iTunes app store. Should I be doing this a different way?
Make sure you have a canvas url defined for your app.
This should work. Also make sure your app delegate is set up.
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
APP_ID, #"app_id",
URL_TO_SITE, #"link",
URL_TO_PIC, #"picture",
LINK_TITLE, #"name",
#" ", #"caption",
LINK_DESCRIPTION, #"description",
nil];
[facebook dialog:#"stream.publish"
andParams:params
andDelegate:self];
Claudia is right. In the app settings you do need to fill-in the 'app on facebook' section and provide a canvas URL.
I guess the point is that if you don't do that there is nothing for facebook to direct an invited user to, so it doesn't display the request.
If your app is purely a mobile app then you could just create a simple webpage for the canvas which directs users to the app store.

iOS SDK posting a link & displaying a thumbnail

I've managed to get the Facebook iOS SDK implemented into my project quite nicely with the assistance of the provided FB documentation.
My app's FB integration is quite simple: A Facebook share button, which allows a user to post a link to their FB wall with a user-supplied comment. Nothing earth-shattering or ground breaking.
However, I would like to go one step further. I don't have a thumbnail to display for the link (i.e. my own image URL), but I would like the thumbnail to be automatically selected by Facebook.
Similar to how, from Facebook in a web browser, if you choose to Share a link from CNN.com, Facebook will automatically select thumbnails for the desired page to be shared, AND it even gives you the option to checkbox "no thumbnail".
From the iOS dialog to share the link, I would like the thumbnail to automatically be selected (presumably it's generated from the link that you're trying to share, i.e. FB just grabs images from the page).
Is this possible? Again, I do not want to display "picture" with a supplied image URL in the 'attachment' NSDictionary below because I won't have the image URL. I just want to display a hyperlink and have FB post the link on the user's wall with their comment and have FB supply the thumbnail image (similar to how it would if you posted from a web browser).
Basically the code from Stack Overflow is:
SBJSON *jsonWriter = [[SBJSON new] autorelease];
NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary
dictionaryWithObjectsAndKeys: #"Always Running", #"text", #"http://itsti.me/", #"href",
nil], nil];
NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
#"a long run", #"name",
#"The Facebook Running app", #"caption",
#"it is fun", #"description",
#"http://itsti.me/", #"href", nil];
NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"Share on Facebook", #"user_message_prompt",
actionLinksStr, #"action_links",
attachmentStr, #"attachment",
nil];
[_facebook dialog:#"stream.publish" andParams:params andDelegate:self];
A different approach to this would be to call the Graph API instead of using a dialog. So if you make an HTTP POST to https://graph.facebook.com/me/feed and supply the message and link parameters the image should be automatically selected by Facebook. See https://developers.facebook.com/docs/reference/api/user/#links.
You will have to generate the UI to ask the user to enter the message. If that can work for you then this is the way to go.
I don't think you have to post a picture. Also, what Facebook is doing is getting Open Graph tags (meta tags in the beginning of web documents just for this purpose). You should be able to simply post a link and a message, and it will "lint"- read the meta tags and post the picture, summary, etc. for that web page.
You may try using Open Graph graph actions instead of share dialogs. It will do more of what you want.http://developers.facebook.com/docs/opengraph/

How to post both text, image and link at once on friends' walls via facebook API

How to let someone post on his/her friends' walls via facebook API, similar to instagr.am iPhone application lets you post on your own wall?
How to show a list of friends and allow selecting them?
How to post both text, image and link at once?
As it happens, Facebook has an iOS SDK available, and instructions on how to use that to post feed items (either with an interactive dialog, or with their Graph API).
i did this way. it works fine.. u can post for multiple frnds as well.
NSMutableDictionary* params1 = [NSMutableDictionary dictionaryWithObjectsAndKeys:
<appId>, #"api_key",
#"Happy Birthday....", #"message",
#"http://www.youtube.com/watch?v=wFh-rX_Sfhs", #"link",
#"http://www.99desi.com/wp-content/uploads/2011/03/Happy-Birthday.jpg", #"picture",
#"Many More Happy returns Of the Day...", #"name",
#" Believing hear, what you deserve to hear..", #"description",nil];
[facebook requestWithGraphPath:#"<frnd-ID>/feed" andParams:params1 andHttpMethod:#"POST" andDelegate:self];
u can iterate the above step to post same to multi friends.
hope it helps you...