IOS ShareSDK实现分享——微信分享 本地视频分享
Posted 奋斗路上的奋青
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IOS ShareSDK实现分享——微信分享 本地视频分享相关的知识,希望对你有一定的参考价值。
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
以上是关于IOS ShareSDK实现分享——微信分享 本地视频分享的主要内容,如果未能解决你的问题,请参考以下文章
IOS项目集成ShareSDK实现第三方登录分享关注等功能(转)