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

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值