ios 友盟集成分享 细节

//分享到  微信

UMSocialData defaultData].extConfig.wechatSessionData.wxMessageType=UMSocialWXMessageTypeWeb ;

            [UMSocialData defaultData].extConfig.wechatSessionData.title      = title;

            [UMSocialData defaultData].extConfig.wechatSessionData.url = fxurl;

            [[UMSocialDataService defaultDataServicepostSNSWithTypes:@[UMShareToWechatSession] content:content image:Image location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response){

                if (response.responseCode == UMSResponseCodeSuccess) {

                   // NSLog(@"=====分享成功!");

                    [MBProgressHUD showSuccess:@"分享成功" toView:  [UIApplication sharedApplication].keyWindow];

                }else{

                    [MBProgressHUD showSuccess:@"分享失败" toView:  [UIApplication sharedApplication].keyWindow];

                }

//分享到微信朋友圈

  [UMSocialData defaultData].extConfig.wechatTimelineData.wxMessageType=UMSocialWXMessageTypeWeb;

            [UMSocialData defaultData].extConfig.wechatTimelineData.title =title;

            [UMSocialData defaultData].extConfig.wechatTimelineData.url   =fxurl;

            

            [[UMSocialDataService defaultDataServicepostSNSWithTypes:@[UMShareToWechatTimeline] content:content image:Image location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response){

                if (response.responseCode == UMSResponseCodeSuccess) {

                  //  NSLog(@"分享成功!");

                    [MBProgressHUD showSuccess:@"分享成功" toView:  [UIApplication sharedApplication].keyWindow];

                }else{

                [MBProgressHUD showSuccess:@"分享失败" toView:  [UIApplication sharedApplication].keyWindow];

                }

            }];

//分享到新浪

我是把需要分享的url 拼接到 字符串title后面

 [[UMSocialControllerService defaultControllerService] setShareText:[((HEPostDetail *)self.obj).title stringByAppendingString:FXURl] shareImage:Image socialUIDelegate:self];        //设置分享内容和回调对象

            [UMSocialSnsPlatformManager getSocialPlatformWithName:UMShareToSina].snsClickHandler(self,[UMSocialControllerService defaultControllerService],YES);


// 分享到qq 

  [UMSocialData defaultData].extConfig.qqData.title =title;

            [UMSocialData defaultData].extConfig.qqData.url   =fxurl;

            [[UMSocialDataService defaultDataService] postSNSWithTypes:@[UMShareToQQ] content:content image:Image location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *response) {

                if (response.responseCode == UMSResponseCodeSuccess) {               

                    [MBProgressHUD showSuccess:@"分享成功" toView:  [UIApplication sharedApplication].keyWindow];

                } else {

                     [MBProgressHUD showSuccess:@"分享失败" toView:  [UIApplication sharedApplication].keyWindow];

                }

            }];




deleget  写的内容

    [UMSocialData setAppKey:HEYMappKey];

    

    //设置微信AppId,设置分享url,默认使用友盟的网址

    [UMSocialWechatHandler setWXAppId:@"wx23d0f5f7092747fd" appSecret:@"d4624c36b6795d1d99dcf0547af5443d" url:@"http://www.umeng.com/social"];

    

    //设置手机QQAppId,指定你的分享url,若传nil,将使用友盟的网址

    [UMSocialQQHandler setQQWithAppId:@"1104959016" appKey:@"dygzlznZv3eGRWgq" url:@"http://www.umeng.com/social"];




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值