2013-05-28 38 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