2012-11-23 51 views

回答

0

對於iOS < 6,您始終可以使用ShareKit插件。

在這repository,他們共享一個很好的例子來分享您的fb帳戶上的圖像。

看一看類ExampleShareImage

- (void)loadView 
{ 
    [super loadView]; 

    self.imageView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sanFran.jpg"]] autorelease]; 

    imageView.frame = CGRectMake(0,0,self.view.bounds.size.width,self.view.bounds.size.height); 

    [self.view addSubview:imageView]; 
} 

- (void)share 
{ 
    SHKItem *item = [SHKItem image:imageView.image title:@"San Francisco"]; 

    /* optional examples 
    item.tags = [NSArray arrayWithObjects:@"bay bridge", @"architecture", @"california", nil]; 

    //give a source rect in the coords of the view set with setRootViewController: 
    item.popOverSourceRect = [self.navigationController.toolbar convertRect:self.navigationController.toolbar.bounds toView:self.view]; 
    */ 

    SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; 
    [SHK setRootViewController:self]; 
    [actionSheet showFromToolbar:self.navigationController.toolbar]; 
}

您也可以集成FBConnect框架被Facebook提供。

+0

但就像我知道FBConnect需要facebook應用程序。 – Kubba

+0

嘗試共享包,但在我的2個應用程序中,我使用FBConnect,它從來不問我FB應用程序(一個在safari和另一個登錄thr對話框中的SSO)。 –

相關問題