Google + Share getting error alert [closed]

*爱你&永不变心* 提交于 2020-01-05 05:58:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!