2013-05-28 25 views
1

直到昨天我能够执行以下代码来分享用户的谷歌+个人资料,但突然今天它在控制台日志中说,[GPPShareBuilderImpl getURL] |setURLToShare:| must be called for call-to-action to work

代码:
“setURLToShare”必须呼吁号召行动

[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. 
[shareBuilder setTitle:@"AppName" 
      description:@"App description." 
      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:@"post"]; 

// set the text of post. user can edit this before sharing. 
[shareBuilder setPrefillText:@"I just created a trip from XYZ app."]; 

// This will create a call-to-action button with the specified label. 
// - URL specifies where people will go if they click the button on a platform 
// that doesn't support deep linking. 
// - deepLinkID specifies the deep-link identifier that is passed to your native 
// application on platforms that do support deep linking 
[shareBuilder setCallToActionButtonWithLabel:@"Install" 
             URL:[NSURL URLWithString:@"http://www.example.com/"] 
            deepLinkID:@"install"]; 

[shareBuilder open]; 



根据Google+ documentationShare without URL部分)我可以使用下面方法来代替setURLToShare:。这种方法一直工作到昨天。

[shareBuilder setTitle:@"title" 
       description:@"description"; 
       thumbnailURL:@"url"]; 

我还没有在Google+上找到与此相关的内容。我试着删除应用程序并重新安装。任何想法该怎么办?

回答

0

无URL共享仅适用于基本共享,如果您想使用交互式帖子,则需要调用setURLToShare。您可以在标题GPPShare.h中找到注释:

// Note: In order to set the call-to-action button: 
// 1. User must have been authenticated with scopes including 
// "https://www.googleapis.com/auth/plus.login". 
// 2. |setURLToShare:| must also be called. 

对不起,我们将更新文档以使需求清晰。谢谢!

+0

这怎么可能?我可以在问题出现的前一天使用交互式帖子。即使我可以发布帖子的屏幕截图,如果你只是想看看。 – Geek

+0

一旦我开始出现这个问题,不会发布'description',而发布'title'和'thumbnailURL'。 – Geek

+0

在iOS框架中存在一个错误,它没有通知错误,现在已经修复。 – Silvano