share video on Facebook from iPhone App - iphone

How do I share video link (video(.mov format) is on server and want to share link of it through my iPhone app)??
I am able to to send the link of the video and send an image along with it.
But when I click on the link the video is playing in the other page.
All I want is that the video is played on the same page and my image should act as thumbnail image.

I was able to get it to work with facebook dialog using the following parameters:
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
title, #"name",
caption, #"caption",
description, #"description",
itemLink, #"link",
source, #"source",
thumbnailURL, #"picture",
#"video", #"type",
nil];
The source is the embedded video source+player and the link is where the user will go if they click on your title (e.g. the video on your webpage).

Related

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.

facebook dialog feed custom picture from your app instead of an url

Is it possible to encode a picture from our iPhone to use with facebook dialog feed instead of passing an URL.. !
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
#"Blablabla", #"name",
#"Blablabla", #"caption",
#"Blablabla", #"description",
#"http://google.com", #"link",
#"HTTP:CAN IT BE AN ENCODED PICTURE??", #"picture",
actionLinksStr, #"actions",
nil];
[facebook dialog:#"feed" andParams:params andDelegate:self];
There's a reference link for params:
http://developers.facebook.com/docs/reference/api/post/
I've been stuck at the same problem and was quite shocked that there's no support for uploading images. My solution was to upload the picture to my remote web server and use the link that I've got from server.
I'm uploading to Amazon s3 then using that url to post to the feed.

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/

Can I upload video to Facebook from within an iPhone application?

In the past, I've been able to upload images and text to Facebook from within my iPhone application, but I have not been able to upload video. Does anyone know how to programmatically upload video to Facebook?
You appear to be able to make a facebook.video.upload FBRequest call, similar to how photos are uploaded.
Here is sample for photo upload, I guess similar with video, but seems like more limitation for video.
UIImage *img1 = [UIImage imageNamed:#"me.png"];
NSMutableDictionary * params1 = [NSMutableDictionary dictionaryWithObjectsAndKeys:
img1, #"picture",
nil];
[_facebook requestWithMethodName: #"photos.upload"
andParams: params1
andHttpMethod: #"POST"
andDelegate: self];
Working implementation using TheRonin's answer and the link to Zoul's code on Github can be found here.