谷歌+分享得到错误警报



我必须在Google plus上分享一些文本,但是它显示了警报,保存你的帖子有问题。请再试一次。我正在使用Google+ iOS SDK。

我这边怎么了?2)如何修复此警报?

谢谢。

如果你还没有使用Google+实现登录,那么你必须首先实现Google+登录。

如果你已经实现了,那么看看下面的共享代码:

- (void)googlePlusShare
{
    [GPPShare sharedInstance].delegate = self;
    id<GPPShareBuilder> shareBuilder = [[GPPShare sharedInstance] shareDialog];
    // This line will manually fill out the title, description, and thumbnail of the
    // item you're sharing.
    // thumbnailURL is url of image you want to display.
    [shareBuilder setTitle:@"Title of your post"
               description:@"Description of your post"
               thumbnailURL:[NSURL URLWithString:@"https:www.example.com/image.png"]];
    /* This line passes the deepLinkID to our application
     if somebody opens the link on a supported mobile device */
    [shareBuilder setContentDeepLinkID:@"share"];
    // set the text of post. user can edit this before sharing.
    [shareBuilder setPrefillText:@"Your post texts."];
    [shareBuilder open];
}


这段代码使用setTitle:description:thumbnailURL:方法来设置细节。

如果你的应用程序有一个web URL,那么你可以使用下面的方法而不是setTitle:description:thumbnailURL:

[shareBuilder setURLToShare:[NSURL URLWithString:@"https://www.example.com/restaurant/sf/1234567/"]]; 


有关Google+共享的更多详细信息,请查看Google+共享。

EDIT:我建议您先检查您的sign in实现是否正常。

最新更新