2012-07-09 59 views
1

我在iPhone中使用Google Plus API成功发布了内容和(链接)网址。 使用下面的代码:如何在iOS应用程序中发布Google Plus上的图像

googleShare =[[[GooglePlusShare alloc] initWithClientID:@"my key"] autorelease]; 


    [googleShare setDelegate:self]; 
    appDelegate.shareGOOGLe =googleShare; 


    NSString *inputURL = @""; 
    NSURL *urlToShare = [inputURL length] ? [NSURL URLWithString:inputURL] : nil; 

    NSLog(@"%@",urlToShare); 
    NSString *inputText = @"TEst Sharing testing from iOS 5.0"; 
    NSString *text = [inputText length] ? inputText : nil; 
     NSLog(@"%@",text); 

    [[[[googleShare shareDialog] 
     setURLToShare:urlToShare] 
     setPrefillText:shareMessge] open]; 

但是我要发表图片谷歌加。

任何人都可以帮助我吗?

在此先感谢。

+2

分享图片有什么** **你试过吗? – Pripyat 2012-07-09 11:11:29

+5

降级此问题的原因是什么? – iChirag 2012-07-16 17:26:38

+1

你能指定你真正想要做什么吗?我认为你还没有正确地使用谷歌 – Chintan 2012-07-16 17:26:45

回答

5

目前无法通过Google+ iOS SDK共享Google+上的图片。

+0

可以请你建议我怎样才能分享图像在谷歌+通过使用这种方法https://developers.google.com/+/mobile/ios/share/basic-share – 2016-10-10 13:02:20

1

@Chirag ...你应该看到用于iPhone/iPad的Flipboard应用程序。它在Google+帐户上分享链接,评论和图片。请随时注意并让我知道我是否有任何问题。

+0

看到他发布答案的日期。快一年了。 – Jasmeet 2014-12-05 05:34:20

3

这是可能与谷歌共享图片加

- (IBAction) didTapShare: (id)sender { 
    id<GPPNativeShareBuilder> shareBuilder = [[GPPShare sharedInstance] nativeShareDialog]; 
    [shareBuilder attachImage:[UIImage imageNamed:@"yourImagename.png"]]; 
    [shareBuilder open]; 
} 

https://developers.google.com/+/mobile/ios/share/

+0

这已弃用。不使用。 – Hima 2017-04-20 09:48:12

1

引用这些链接将帮助:

链接显示的方式和内容可以共享。

  1. https://developers.google.com/+/mobile/ios/share/

在链接1的bottome,它提到“附加媒体共享帖子。您可以将照片和短片,以您的文章为您的用户分享他们的信息流。”

  • https://developers.google.com/+/mobile/ios/share/media
  • 链路2示出了代码段共享的媒体;图像和视频

    以下是代码片段在谷歌+

    - (IBAction) didTapShare: (id)sender { 
    id<GPPNativeShareBuilder> shareBuilder = [[GPPShare sharedInstance] nativeShareDialog]; 
    
    // Set any prefilled text that you might want to suggest 
    [shareBuilder setPrefillText:@"Achievement unlocked! I just scored 99 points. Can you beat me?"] 
    
    NSString *fileName = @"samplemedia1"; 
    [shareBuilder attachImage:[UIImage imageNamed:fileName]; 
    
    [shareBuilder open]; 
    } 
    
    相关问题