【问题标题】:How to post an images on Google Plus in an iOS Application如何在 iOS 应用程序中在 Google Plus 上发布图像
【发布时间】:2014-11-28 19:55:00
【问题描述】:

我在 iphone 中使用 Google Plus API 成功发布了内容和(链接)URL。 使用以下代码:

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];

但我想将图片发布到 google plus。

谁能帮帮我?

提前致谢。

【问题讨论】:

  • 尝试了什么?
  • 什么是降低这个问题的理由??
  • 你能具体说明你真正想要做什么吗?我认为您在 Google 上的浏览​​不正确
  • 人们白天有事情要做,并且会希望将他们的业余时间明智地花在正确的问题上。如果您想将图像发布到 Google Plus,请在 Google 上查找指针。如果您没有找到任何东西或只找到部分答案,请在 StackOverflow 上寻求澄清。 GiveMeTheCodez 未开启。
  • @Prypiat 如果有人在谷歌上找不到任何东西并发布问题怎么办?我认为上述问题非常有效。他需要一些指导而不是代码。顺便说一句,Chirag Shah 回答了对我和其他人有帮助的问题。

标签: iphone ios ios5 google-plus


【解决方案1】:

目前无法使用 Google+ iOS SDK 共享 Google+ 上的图片。

【讨论】:

【解决方案2】:

这可以与 google plus 分享图片

- (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/

【讨论】:

  • 已弃用。不要使用。
【解决方案3】:

@Chirag... 您应该会看到适用于 iPhone/iPad 的 Flipboard 应用程序。它在 Google+ 帐户上分享链接、评论和图片。请看一下,如果我在任何时候错了,请告诉我。

【讨论】:

  • 查看他发布答案的日期。差不多一年前了。
【解决方案4】:

这些链接会有所帮助:

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

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

在链接 1 的底部,它提到了“将媒体附加到您共享的帖子中。您可以将图片和电影附加到您的帖子中,以便您的用户分享到他们的信息流中。”

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

链接 2 显示了共享媒体的代码 sn-p ;图片和视频

以下是在 google+ 上分享图片的代码 sn-p

- (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];
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-18
    • 1970-01-01
    • 2012-02-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多