我需要在Google Plus上分享照片:

我所做的是:

AppDelegate.m

 static NSString * const kClientId = @"MyClient ID";
 [GPPSignIn sharedInstance].clientID = kClientId;


在按钮上单击

- (IBAction)SharePressed:(id)sender {

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:@"Try Sharing g+" description:@"demo" thumbnailURL:[NSURL URLWithString:@"http://UrlForShaingPhoto/asd/imagename.jpg"]];

[shareBuilder open];


但是点击显示

[lvl=3] -[GPPShareBuilderImpl getURL] Content deep-link ID is required with title and description.


并没有任何反应

最佳答案

正是这句话-如果您不提供URL,则需要提供深层链接ID。因此,尝试添加:

[shareBuilder setContentDeepLinkID:@"my_id_here"]


如果您想知道为什么必须这样做-以便共享可以放在某个地方。如果没有URL,则假定可以转到移动应用程序,因此我们需要一个Deeplink ID。如果您的应用配置为进行深层链接,那么在移动设备上点击该帖子的用户将被带回该应用:https://developers.google.com/+/mobile/ios/share#deep_linking

08-15 20:50