sina微博
WBMessageObject *message = [WBMessageObject message];
WBWebpageObject *webpage = [WBWebpageObject object];
微信好友
// if ([WXApi isWXAppInstalled] == 1) {
// SendMessageToWXReq *sendReq = [[SendMessageToWXReq alloc] init];
// sendReq.bText = NO;
// sendReq.scene = 1;
// WXMediaMessage *urlMessage = [WXMediaMessage message];
// if (self.shareStr != nil) {
// urlMessage.title = [NSString stringWithFormat:@"%@ %@",self.shareTitle ,self.shareStr];
// }else {
// urlMessage.title = @"下";//标题
// }
//// urlMessage.description = @"副标题";
//
// // if (self.shareImage != nil) {
// // UIImageView *shareImageView = [[UIImageView alloc] init];
// // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// // [shareImageView hr_setImageWithObjectKey:self.shareImage placeholderImage:nil options:(HRImageContentTypeWEBP) completed:^(UIImage *image, NSError *error) {
// // shareImageView.image = image;
// //
// // }];
// // });
// // UIImage *image = shareImageView.image;
// // NSData *photo = UIImageJPEGRepresentation(image, 0.4);
// // [urlMessage setThumbImage:[UIImage imageWithData:photo]];
// // }else {
// UIImage *image = [UIImage imageWithContentsOfFile:[NSString stringWithContentsOfURL:[self shareImageUrl] encoding:(NSUTF8StringEncoding) error:nil]];
// [urlMessage setThumbImage:image];
// // }
//
// WXWebpageObject *webObj = [WXWebpageObject object];
//
// webObj.webpageUrl = [self shareUrl];
//
//
// urlMessage.mediaObject = webObj;
// sendReq.message = urlMessage;
//
// [WXApi sendReq:sendReq];
// }else{
// [self showPopupView:@"官人~\n请安端
微信朋友圈
// if ([WXApi isWXAppInstalled] == 1) {
// SendMessageToWXReq *sendReq = [[SendMessageToWXReq alloc] init];
// sendReq.bText = NO;
// sendReq.scene = 1;
// WXMediaMessage *urlMessage = [WXMediaMessage message];
// if (self.shareStr != nil) {
// urlMessage.title = [NSString stringWithFormat:@"%@ %@",self.shareTitle ,self.shareStr];
// }else {
// urlMessage.title = @"天下";//标题
// }
//// urlMessage.description = @"副标题";
//
// // if (self.shareImage != nil) {
// // UIImageView *shareImageView = [[UIImageView alloc] init];
// // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// // [shareImageView hr_setImageWithObjectKey:self.shareImage placeholderImage:nil options:(HRImageContentTypeWEBP) completed:^(UIImage *image, NSError *error) {
// // shareImageView.image = image;
// //
// // }];
// // });
// // UIImage *image = shareImageView.image;
// // NSData *photo = UIImageJPEGRepresentation(image, 0.4);
// // [urlMessage setThumbImage:[UIImage imageWithData:photo]];
// // }else {
// UIImage *image = [UIImage imageWithContentsOfFile:[NSString stringWithContentsOfURL:[self shareImageUrl] encoding:(NSUTF8StringEncoding) error:nil]];
// [urlMessage setThumbImage:image];
// // }
//
// WXWebpageObject *webObj = [WXWebpageObject object];
//
// webObj.webpageUrl = [self shareUrl];
//
//
// urlMessage.mediaObject = webObj;
// sendReq.message = urlMessage;
//
// [WXApi sendReq:sendReq];
// }else{
// [self showPopupView:@"官人~\n请安装微信客户端
QQ空间
// if ([TencentApiInterface isTencentAppInstall:(kIphoneQQ)]) {
//
// QQApiNewsObject *newsObj;
// newsObj = [QQApiNewsObject objectWithURL:[NSURL URLWithString:[self shareUrl]]
// title:[self shareTitleString]
// description:[self descriptionString]
// previewImageURL:[NSURL URLWithString:[self shareImageUrl]]];
//
//
// uint64_t cflag = 1;
// [newsObj setCflag:cflag];
// SendMessageToQQReq *req = [SendMessageToQQReq reqWithContent:newsObj];
// //分享到QZone
// [QQApiInterface SendReqToQZone:req];
// }else{
// [self showPopupView:@"官人~\n请安装QQ客户端"];
// }