直到昨天,我能够执行以下代码以在用户的 google+ 个人资料上共享,但今天突然在控制台日志中显示[GPPShareBuilderImpl getURL] |setURLToShare:| must be called for call-to-action to work
.
代码 :
[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+ 文档(Share without URL
部分),我可以使用以下方法而不是setURLToShare:
. 这种方法直到昨天都运行良好。
[shareBuilder setTitle:@"title"
description:@"description";
thumbnailURL:@"url"];
我在 Google+ 上没有找到与此相关的任何内容。我尝试删除应用程序并重新安装。知道该怎么做吗?