IKK*_*KKA 1 iphone objective-c ios
我想从我的iPhone应用程序分享图像,链接等到Facebook.My应用程序链接,阳离子,名称和描述成功发布.但我无法分享形象.请关注我的代码..
UIImage *image = [UIImage imageNamed:@"sample.png"];
NSData *imgData = UIImageJPEGRepresentation(image, 1.0);
self.dictionary =[[NSMutableDictionary alloc] initWithObjectsAndKeys: @"https://www.google.com/ios", @"link",
imgData, @"data",
@"AppName", @"name",
@"Testing", @"caption",
@"say something about this", @"description",
nil];
Run Code Online (Sandbox Code Playgroud)
我的分享Facebook代码是..
[facebook requestWithGraphPath:@"/me/feed" andParams:dictionary andHttpMethod:@"POST" andDelegate:self];
Run Code Online (Sandbox Code Playgroud)
我的问题是如何从捆绑中获取图像以及如何将所选图像分享到Facebook?请帮助我..
使用如下:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"image1" ofType:@"png"];
NSData *videoData = [NSData dataWithContentsOfFile:filePath];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"My hat image", @"message", data, @"source", nil];
[facebook requestWithGraphPath:@"/me/photos" andParams:params andHttpMethod:@"POST" andDelegate:self];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2199 次 |
| 最近记录: |