It looks like you're new here. If you want to get involved, click one of these buttons!
oztemel
Posts: 64Registered Users
-(IBAction)ShareFacebook:(id)sender{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@\"FBAccessTokenKey\"]
&& [defaults objectForKey:@\"FBExpirationDateKey\"]) {
facebook.accessToken = [defaults objectForKey:@\"FBAccessTokenKey\"];
facebook.expirationDate = [defaults objectForKey:@\"FBExpirationDateKey\"];
}
if (![facebook isSessionValid]) {
NSArray *permissions = [[NSArray alloc] initWithObjects:
@\"user_likes\",
@\"read_stream\",
@\"publish_stream\",
@\"user_photos\",
@\"user_videos\",
nil];
[facebook authorize:permissions];
[facebook authorize:nil];
NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:7];
[variables setObject:@\"#Your Message\" forKey:@\"message\"];
[variables setObject:@\"#http://Your Youtube Link\" forKey:@\"link\"];
[variables setObject:@\"#This is the bolded copy next to the image\" forKey:@\"name\"];
[variables setObject:@\"#This is the plain text copy next to the image. All work and no play makes Jack a dull boy.\" forKey:@\"description\"];
[variables setObject:@\"#Your story\" forKey:@\"story\"];
[variables setObject:@\"#http://Your Youtube Link\" forKey:@\"source\"];
[variables setObject:@\"#Your caption\" forKey:@\"caption\"];
[facebook requestWithGraphPath:@\"/me/feed\" andParams:variables andHttpMethod:@\"POST\" andDelegate:self];
}
Replies
so the first thing you have to do is to make the class that you have the ShareFacebook method on follow the FBDialogDelegate,FBRequestDelegate and FBSessionDelegate protocol like this:
after which you have to create the delegate method fbDidLogin so that in your ShareFacebook method where you call the
btw ~ you called the authorize method twice when you should just call it once by passing in the permissions.
so if you want you can leverage on the Facebook SDK and show the post to wall dialog in the fbDidLogin method by using:
where params is a NSMutableDictionary where you have parameters for the App ID, link URL, picture URL, name, caption, description and message for the dialog.
You should follow Drop Dem on Twitter <a href="http://twit
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomeand share button is:
[CODE]NSString *filePath = [[NSBundle mainBundle] pathForResource:@"icon_57" ofType:@"png"];
NSData *videoData = [NSData dataWithContentsOfFile:filePath];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
videoData, @"G
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomeand getting that error:
how can I validate the session...???
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI fixed my problems by bellowed tutorial...
How To Post on Facebook with Your iPhone App | Ray Wenderlich
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome