Third-party SDK sharesdk for iOS social sharing

Source: Internet
Author: User

Sharesdk is powerful and detailed on its official website. Http://sharesdk.cn

Add the SDK to your project. The downloaded package contains detailed instructions. Third-party packages in China are still less than those made by foreigners. For exampleCodeThe architecture, detailed description of the document, and so on.

At least the instructions seem obscure. Unlike the pictures and texts made by foreigners, the step by step statements made by foreigners are very detailed and easy to understand. There is a small problem when using sharesdk 2.0.

Paste the code in specific situations

Nsstring * ImagePath = [[nsbundle mainbundle] pathforresource: @"  Audio  " Oftype: @"  JPG  "  ];  //  Construct shared content      ID <Isscontent> publishcontent = [sharesdk content: Nil //  @ "Share content" Defaultcontent: @"  Shared content by default. displayed when no content exists  "  Image: [sharesdk imagewithpath: ImagePath] title:  @"  Sharesdk  "  URL:  @" Http://www.sharesdk.cn  "  Description:  @"  This is a test message.  "  Mediatype: sspublishcontentmediatypenews]; [sharesdk show?actionsheet: Nil sharelist: Nil content: publishcontent statusbartips: Yes autexceptions: Nil limit options: nil result: ^ (Sharetype type, sspublishcontentstate state, ID <Issstatusinfo> statusinfo,ID <Icmerrorinfo> Error, bool end ){  If (State = Sspublishcontentstatesuccess) {nslog (  @"  Shared successfully  "  );}  Else   If (State = Sspublishcontentstatefail) {nslog ( @"  Failed to share, error code: % d, error Description: % @  "  , [Error errorcode], [error errordescription]) ;}}]; 

This code snippet will be reported when ImagePath is nil"Failed to share,Error Code20007,Error description:Make sure to useMultpartUploaded image"

Error

Because when ImagePath is nil

 
[Sharesdk imagewithpath: ImagePath] The returned value is incorrect. If you do not share the image, set this parameter to nil.
This problem has already been reported to the Technical Support Team, and the Technical Support Team of sharesdk is still relatively fast.

In addition, if you only want to use anything, add anything to avoid your app being too bloated. I consulted sharesdk technical support and replied as follows:
1: You can delete the framework under the connection directory in the SDK.
2: the framework and bundle that cannot be used in the UI directory can also be deleted.
3: If you do not need to share it with QQ friends, you can remove the extend.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.