嗨我使用Facebook Feed分享对话框面对Post图像的奇怪问题。我正在使用这个波纹管代码: -
-(IBAction)shaerFacebook
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"savedImage2.png"];
NSURL *imageFileURL =[NSURL fileURLWithPath:savedImagePath];
UIImage *imagetoshare=[UIImage imageWithData:[NSData dataWithContentsOfURL:imageFileURL]];
if ([FBDialogs canPresentShareDialogWithParams:params]) {
// Present share dialog
id<FBGraphObject> pictureObject =
[FBGraphObject openGraphObjectForPostWithType:@"mypicture:picture"
title:@"title"
image:imagetoshare
url:imagetoshare
description:@""];
id<FBOpenGraphAction> action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];
[action setObject:pictureObject forKey:@"picture"];
[FBDialogs presentShareDialogWithOpenGraphAction:action
actionType:@"Photoshare:cook"
previewPropertyName:@"picture"
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
if(error) {
NSLog(@"Error: %@", error.description);
} else {
NSLog(@"Success");
}
}];
// If the Facebook app is NOT installed and we can't present the share dialog
}
}
它将导航facebook
原生应用程序显示带有图像的对话框,并且只需一秒钟它将重定向到我无法发布的应用程序。我做了很多谷歌,但没有得到解决方案。请帮我解决这个问题。
Facebook应用程序有任何特定的变化吗?