ios 友盟集成分享 细节
2015-12-19 13:45
483 查看
//分享到 微信
UMSocialData
defaultData].extConfig.wechatSessionData.wxMessageType=UMSocialWXMessageTypeWeb
;
[UMSocialData
defaultData].extConfig.wechatSessionData.title = title;
[UMSocialData
defaultData].extConfig.wechatSessionData.url = fxurl;
[[UMSocialDataService
defaultDataService] postSNSWithTypes:@[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
defaultDataService] postSNSWithTypes:@[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"];
//设置手机QQ的AppId,指定你的分享url,若传nil,将使用友盟的网址
[UMSocialQQHandler
setQQWithAppId:@"1104959016"
appKey:@"dygzlznZv3eGRWgq"
url:@"http://www.umeng.com/social"];
UMSocialData
defaultData].extConfig.wechatSessionData.wxMessageType=UMSocialWXMessageTypeWeb
;
[UMSocialData
defaultData].extConfig.wechatSessionData.title = title;
[UMSocialData
defaultData].extConfig.wechatSessionData.url = fxurl;
[[UMSocialDataService
defaultDataService] postSNSWithTypes:@[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
defaultDataService] postSNSWithTypes:@[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"];
//设置手机QQ的AppId,指定你的分享url,若传nil,将使用友盟的网址
[UMSocialQQHandler
setQQWithAppId:@"1104959016"
appKey:@"dygzlznZv3eGRWgq"
url:@"http://www.umeng.com/social"];
相关文章推荐
- Expected identifier or '(' Unknown type name 'NSString'
- iOS开发正则表达式的使用
- storyboard xib下label怎么自适应宽度高度
- ios Foundation框架中的可变和不可变对象NSArray 和NSMutableArray(二)
- iOS9.0 NSLayoutAnchor初探
- 整理下iOS常用的三方库,以备查阅
- iOS 引导页
- 如何设计一个 iOS 控件?(iOS 控件完全解析)
- iOS中出现循环引用时常见的三种情况
- iOS崩溃调试的使用和技巧总结
- 简单讲解iOS应用开发中的MD5加密的相关使用
- iOS-----使用NSURLConnection
- IOS视图加载生命周期
- iOS学习笔记(2)--Xcode6.1创建仅xib文件无storyboard的hello world应用
- ios Foundation框架中的可变和不可变对象NSString 和NSMutableString(一)
- iOS,Xcode7真机调试
- Nagios check_logfiles插件的使用记录
- iOS 应用程序运行流程
- iOS框架的搭建以及一些设计的优缺点。
- iOS的界面触摸事件处理机制,然后用一个实例来说明下应用场景.