NSArray* imageArray = @[[UIImage imageNamed:@"icon.png"]];
if (imageArray) {
NSMutableDictionary *shareParams = [NSMutableDictionary dictionary];
[shareParams SSDKSetupShareParamsByText:@"魔印plus一款好用的3D打印辅助软件"
images:imageArray
url:[NSURL URLWithString:@"https://itunes.apple.com/app/id1206801920"]
title:@"魔印plus"
type:SSDKContentTypeAuto];
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"456" ofType:@"mp4"];
[shareParams SSDKSetupWeChatParamsByText:@"本地视频分享。。。"
title:@"视频分享"
url:nil
thumbImage:[UIImage imageNamed:@"icon.png"]
image:[UIImage imageNamed:@"icon.png"]
musicFileURL:nil
extInfo:nil
fileData:nil
emoticonData:nil
sourceFileExtension:@"mp4"
sourceFileData:filePath
type:SSDKContentTypeFile
forPlatformSubType:SSDKPlatformSubTypeWechatSession];
//2、分享(可以弹出我们的分享菜单和编辑界面)
[ShareSDK showShareActionSheet:nil //要显示菜单的视图, iPad版中此参数作为弹出菜单的参照视图,只有传这个才可以弹出我们的分享菜单,可以传分享的按钮对象或者自己创建小的view 对象,iPhone可以传nil不会影响
items:nil
shareParams:shareParams
onShareStateChanged:^(SSDKResponseState state, SSDKPlatformType platformType, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error, BOOL end) {
switch (state) {
case SSDKResponseStateSuccess:
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"分享成功"
message:nil
delegate:nil
cancelButtonTitle:@"确定"
otherButtonTitles:nil];
[alertView show];
break;
}
case SSDKResponseStateFail:
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"分享失败"
message:[NSString stringWithFormat:@"%@",error]
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil, nil];
[alert show];
break;
}
default:
break;
}
}
];}
参考地址http://blog.csdn.net/qq_33777090/article/details/51282547