Iphone 在facebook上共享html
在我的iPad应用程序中,我正在加载HTML5页面,我想将这些页面共享到Facebook。可能吗?我找了很多,但找不到任何帮助。我的应用程序应支持iOS5或更高版本。任何帮助都要感激 我正在使用下面的分享图像Iphone 在facebook上共享html,iphone,ios,objective-c,html,ipad,Iphone,Ios,Objective C,Html,Ipad,在我的iPad应用程序中,我正在加载HTML5页面,我想将这些页面共享到Facebook。可能吗?我找了很多,但找不到任何帮助。我的应用程序应支持iOS5或更高版本。任何帮助都要感激 我正在使用下面的分享图像 FbGraphFile *graph_file = [[FbGraphFile alloc] initWithImage:picture]; [variables setObject:graph_file forKey:@"file"]; [variables se
FbGraphFile *graph_file = [[FbGraphFile alloc] initWithImage:picture];
[variables setObject:graph_file forKey:@"file"];
[variables setObject:@" image : Shared Via IOS application" forKey:@"message"];
FbGraphResponse *fb_graph_response = [fbGraph doGraphPost:@"117795728310/photos" withPostVars:variables];
我也有同样的问题,
解决方案
是在UIWebView
中呈现HTML5页面,当它加载时从中捕获图像
,然后共享
+(UIImage *)imageFromWebView:(UIWebView *)view
{
// tempframe to reset view size after image was created
CGRect tmpFrame = view.frame;
// set new Frame
CGRect aFrame = view.frame;
aFrame.size.height = [view sizeThatFits:[[UIScreen mainScreen] bounds].size].height;
view.frame = aFrame;
// do image magic
UIGraphicsBeginImageContext([view sizeThatFits:[[UIScreen mainScreen] bounds].size]);
CGContextRef resizedContext = UIGraphicsGetCurrentContext();
[view.layer renderInContext:resizedContext];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
// reset Frame of view to origin
view.frame = tmpFrame;
return image;
}
请澄清你的问题。Facebook允许共享HTML链接或媒体。您的
HTML5页面的格式是什么?