2.26 QQ,微信分享
一、纯图片分享
1.接口形式
-(void)shareImageWithFilePath:(NSString *)file shareType:(RNShareType)shareType completion:(RNShareHanlder)completion;
2.接口参数
file:图片地址(仅限本地)
shareType:分享类型
RNSHARETYPE_WECHAT:微信分享
RNSHARETYPE_WECHATLINE:微信朋友圈分享
RNSHARETYPE_QQ:QQ好友分享
RNSHARETYPE_QZONE:QQ空间分享
completion:回调
3.接口调用
[[RNSDKApi sharedInstance] shareImageWithFilePath:path shareType:RNSHARETYPE_QZONE completion:^(int code) {
if (code == 0){ //分享成功
}
}];
二、链接分享
1.接口形式
// Some code
-(void)shareUrlWithUrl:(NSString *)url
title:(NSString *)title
description:(NSString *)description
thunbImageFile:(NSString *)thumbImageFile
shareType:(RNShareType)shareType
completion:(RNShareHanlder)completion
2.接口参数
url:分享链接地址(html链接)
shareType:分享类型
RNSHARETYPE_WECHAT:微信分享
RNSHARETYPE_WECHATLINE:微信朋友圈分享
RNSHARETYPE_QQ:QQ好友分享
RNSHARETYPE_QZONE:QQ空间分享
title:主标题(必填)
description:副标题(必填)
thunbImageFile:缩略图片地址(仅限本地,微信限制最大32KB)
completion:回调
3.接口调用
// Some code
[[RNSDKApi sharedInstance] shareUrlWithUrl:self.linkUrlTextf.text title:self.titleTextf.text description:self.destributionTextf.text thunbImageFile:path shareType:RNSHARETYPE_WECHATLINE completion:^(int code, NSString *msg) {
if (code == 0){
NSLog(@"分享成功");
}
}];
Last updated
Was this helpful?