//开发者分享的文本内容
switch (indexPath.row) {
case 0:
{//微信
if ([WXApi isWXAppInstalled]) {
//链接
WXMediaMessage *message = [WXMediaMessage message];
message.title = @"微厘直播";
message.description = @"是一个好看的购物直播平台";
WXWebpageObject *ext = [WXWebpageObject object];
ext.webpageUrl = JUMP_APPSTORE;
message.mediaObject = ext;
message.mediaTagName = @"ISOSHOW_JUMP_APPSTORE";
SendMessageToWXReq *sendReq = [[SendMessageToWXReq alloc]init];
sendReq.message = message;
sendReq.bText = NO;
//存文本
// SendMessageToWXReq* sendReq = [[SendMessageToWXReq alloc] init];
// sendReq.scene = WXSceneSession;
// sendReq.bText = YES;
// sendReq.text = JUMP_APPSTORE;
[WXApi sendReq:sendReq];
}else{
[AlertUtil alert:@"您尚未安装微信APP,请先安装再使用." inViewController:self.viewController];
}
}
break;
case 1:
//将内容分享到qq
if([QQApiInterface isQQInstalled]){
//链接
UIImage *img = [UIImage imageNamed:@"logo_new_icon"];
QQApiURLObject *txtObj = [[QQApiURLObject alloc]initWithURL:[NSURL URLWithString:JUMP_APPSTORE] title:@"微厘直播" description:@"这是一个直播购物平台" previewImageData:UIImagePNGRepresentation(img) targetContentType:QQApiURLTargetTypeNews];
//存文本
// QQApiTextObject *txtObj = [QQApiTextObject objectWithText:JUMP_APPSTORE];
txtObj.shareDestType = ShareDestTypeQQ;
SendMessageToQQReq *req = [SendMessageToQQReq reqWithContent:txtObj];
[QQApiInterface sendReq:req];
}else{
[AlertUtil alert:@"您尚未安装QQ,请先安装再使用." inViewController:self.viewController];
}
}
break;
case 2:
{//微博
if (![WeiboSDK isWeiboAppInstalled]) {
[AlertUtil alert:@"您尚未安装微博客户端,请先安装再使用." inViewController:self.viewController];
}else {
// //多媒体
UIImage *img = [UIImage imageNamed:@"logo_new_icon"];
WBMessageObject *message = [WBMessageObject message];
message.text = @"这是一个直播购物平台";
WBWebpageObject *webObject = [WBWebpageObject object];
// 不能为空,否则会失败
webObject.webpageUrl = JUMP_APPSTORE;
webObject.objectID = @"wb_app_itunes_jump";
//title 不能为空
webObject.title = @"微厘直播";
webObject.description = @"这是一个直播购物平台";
//缩略图
webObject.thumbnailData = UIImagePNGRepresentation(img);
message.mediaObject = webObject;
WBSendMessageToWeiboRequest *weiboRequest = [WBSendMessageToWeiboRequest requestWithMessage:message];
[WeiboSDK sendRequest:weiboRequest];
// //二维码
// UIImage *img = [UIImage imageNamed:@"er_ma_down"];
// WBMessageObject *message = [WBMessageObject message];
// message.text = @"直播分享";
// WBImageObject *obj = [WBImageObject object];
// obj.imageData = UIImagePNGRepresentation(img);
// message.imageObject = obj;
// WBSendMessageToWeiboRequest *request = [WBSendMessageToWeiboRequest requestWithMessage:message];
// [WeiboSDK sendRequest:request];
// //网址链接
// WBMessageObject *message = [WBMessageObject message];
// message.text = JUMP_APPSTORE;
//
// WBSendMessageToWeiboRequest *request = [WBSendMessageToWeiboRequest requestWithMessage:message];
// [WeiboSDK sendRequest:request];
}
}
break;
default:
break;