Share image from bundle and link on Facebook in iphone

后端 未结 1 1159
小蘑菇
小蘑菇 2021-01-24 08:17

I want to share image,link etc to Facebook from my iphone app.My app Link,cation,name and description posted successfully. But i can\'t share image. Please follow my code..

相关标签:
1条回答
  • 2021-01-24 09:11

    use like below:

    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];
    
    0 讨论(0)
提交回复
热议问题