I'm trying to use facebook within my App by posting a screenshot of my App on my wall.
I already made the functions for taking a screenshot
Code:
and for posting stuff on my facebook wall with an icon, title and small description.
Code:
Any suggestions of how to put my screenshot within the postToWall method? Thanks in advance!
I already made the functions for taking a screenshot
Code:
Code:
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
and for posting stuff on my facebook wall with an icon, title and small description.
Code:
Code:
- (void)postToWall {
FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease];
dialog.userMessagePrompt = @"Enter your message:";
dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"%@ share's a photo\",\"href\":\"mywebsite.com/\",\"caption\":\"%@thinks this is a nice photo\",\"description\":\"\",\"media\":[{\"type\":\"image\",\"src\":\"mywebsite.com/icon.png\",\"href\":\"mywebsite.com/\"}]}",
_facebookName, _facebookName];
dialog.actionLinks = @"[{\"text\":\"Get My App\",\"href\":\"http://itunes.apple.com//\"}]";
}
Any suggestions of how to put my screenshot within the postToWall method? Thanks in advance!