问题
I have to share some text on Google plus But it shows the alert, There was a problem saving your post. please try again google plus. I am using the Google+ iOS SDK.
1) Whats wrong in my side? 2) How can I fix this alert?
Thank you.
回答1:
If you have not implemented sign in using Google+ then you have to implement Google Plus sign in first.
If you have already implemented then look at this code for sharing :
- (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];
}
This code uses setTitle:description:thumbnailURL:
method to set details.
If you have a web URL of your app then you can use below method instead of setTitle:description:thumbnailURL:
.
[shareBuilder setURLToShare:[NSURL URLWithString:@"https://www.example.com/restaurant/sf/1234567/"]];
For more detail about Google+ sharing look at Google Plus Sharing.
EDIT : I recommend you first check whether your sign in
implementation works properly.
来源:https://stackoverflow.com/questions/17018678/google-share-getting-error-alert