As shown in figure:
To realize the sina’s share is in this form, the first share content to include in the link, and not directly in the url, sharing type must be SSPublishContentMediaTypeNews
Here’s how to customize sina’s share individually:
Id <ISSCAttachment> remoteAttachment = [ShareSDKCoreService] [ShareSDKCoreService attachmentWithUrl:@"http://f.hiphotos.bdimg.com/album/w%3D2048/sign=df8f1fe50dd79123e0e09374990c5882/cf1b9d16fdfaaf51e6d 1ce528d5494eef01f7a28.jpg"]; // id<ISSCAttachment> localAttachment = [ShareSDKCoreService attachmentWithPath:[[NSBundle mainBundle] pathForResource:@"shareImg" ofType:@"png"]]; //1.2. The following parameters correspond to: <ISSContent> publishContent = [ShareSDK Content :@"Test Content of ShareSDK" defaultContent:nil image:remoteAttachment title:@"test title" url:@"http://www.mob.com" description:nil mediaType:SSPublishContentMediaTypeNews]; / / 1.3, the custom of each platform to share content (not necessary) [self customizePlatformShareContent: publishContent]; / / 1.4, and share a Custom menu item (not necessary) id < ISSShareActionSheetItem > customItem = [ShareSDK shareActionSheetItemWithTitle: @ "Custom" icon:[UIImage imageNamed:@"Icon.png"] clickHandler:^{ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Custom item" message:@"Custom item has been clicked" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alertView show]; }]; NSArray *shareList = [ShareSDK customShareListWithType: ShareSDK customShareListWithType: SHARE_TYPE_NUMBER(ShareTypeSinaWeibo), SHARE_TYPE_NUMBER(ShareTypeFacebook), SHARE_TYPE_NUMBER(ShareTypeWeixiSession), SHARE_TYPE_NUMBER(ShareTypeWeixiTimeline), SHARE_TYPE_NUMBER(ShareTypeSMS), SHARE_TYPE_NUMBER(ShareTypeQQ), SHARE_TYPE_NUMBER(ShareTypeQQSpace), SHARE_TYPE_NUMBER(ShareTypeMail), SHARE_TYPE_NUMBER(ShareTypeCopy), customItem,nil]; Id <ISSContainer> container = [ShareSDK Container]; id<ISSContainer> container = [ShareSDK Container]; [container setIPadContainerWithView:sender arrowDirect:UIPopoverArrowDirectionUp]; / / 2, show the share menu [ShareSDK showShareActionSheet: container shareList: shareList content: publishContent statusBarTips: NO authOptions:nil shareOptions:nil result:^(ShareType type, SSResponseState state, id<ISSPlatformShareInfo> statusInfo, id<ICMErrorInfo> error, BOOL end) {NSLog(@"=== ResponseState :%zi ",state); if (state == SSResponseStateSuccess) {UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Success" message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [alert show]; } else if (state == SSResponseStateFail) { UIAlertView *alert = [[UIAlertView alloc] InitWithTitle :@"Failed" message:[NSString stringWithFormat:@"Error Description: %@",[error errorDescription]] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [alert show]; } }];Copy the code
The above is a complete share, see clearly, is a custom share:
/ / this line of code is the key [self customizePlatformShareContent: publishContent];Copy the code
Take a look at how this method call is implemented and how to implement sina share content customization:
- (void) customizePlatformShareContent: (id < ISSContent >) publishContent {/ / custom QQ space share content [publishContent addQQSpaceUnitWithTitle:@"The title of QQ Space." url:@"http://www.mob.com" site:nil fromUrl:nil comment:@"comment" summary:@"summary" image:nil type:@(4) playUrl:nil nswb:0]; [publishContent addMailUnitWithSubject:@"The subject of Mail" content:@"The content of Mail." isHTML:[NSNumber numberWithBool:YES] attachments:nil to:nil cc:nil bcc:nil]; Id <ISSCAttachment> localAttachment = [ShareSDKCoreService attachmentWithPath:[NSBundle mainBundle] pathForResource:@"shareImg" ofType:@"png"]]; [publishContent addSinaWeiboUnitWithContent: @ "The content of Sina Weibo! http://www.baidu.com" image: localAttachment]; }Copy the code
Not only Sina Weibo, but other platforms can also customize the sharing method. For Sina, the form shown in the image above requires the link to be placed in the shared content, while other platforms have the normal and conventional way. This method is available in ShareSDK. You can check it out by yourself. If you can’t find it, please leave a message to the blogger.