龙图三方登录和分享SDK是一个聚合SDK,目前整合了微信、QQ、新浪微博、Facebook、Twitter等SDK,包含登录、文本分享、图片分享、链接分享等功能。本SDK最低支持iOS9.00
注意:prop.cfg由龙图运营提供,需要加入工程(等同bundle资源).
<key>LSApplicationQueriesSchemes</key>
<array>
<string>wechat</string>
<string>mqqopensdkapiV3</string>
<string>wtloginmqq2</string>
<string>mqq</string>
<string>mqqapi</string>
<string>mqqwpa</string>
<string>mqqbrowser</string>
<string>mttbrowser</string>
<string>mqqOpensdkSSoLogin</string>
<string>mqqopensdkapiV2</string>
<string>sinaweibo</string>
<string>sinaweibohd</string>
<string>weibosdk</string>
<string>weibosdk2.5</string>
<string>weibosdk3.3</string>
<string>weixin</string>
<string>weixinULAPI</string>
<string>fbshareextension</string>
<string>fb-messenger-api</string>
<string>fbapi</string>
<string>fbauth2</string>
</array>
格式按截图所示,或查看demo
facebook单独配置(同Facebook登录配置)
*新版微信和QQ登录和分享必须配置URLLink
例子:
applinks:www.xxxxx.com
地址不需要带前缀和结尾
功能说明
分享
接口定义(C++)
void LTGameSDK::ShareThirdPlatformView(void* content, void (* pfunc)(const char * shareType,int errCode, const char * jsonStr));
接口定义(OC)
- (void)LTSDKShareThirdPlatformView:(NSDictionary *)dict;
分享接口参数:
参数名 | 类型 | 重要性 | 说明 |
---|---|---|---|
content | NSDictionary | (必填) | 分享内容,具体根据分享类型的不同而不同 |
pfunc | void* | (C++必填,OC不填) | 分享回调 |
分享回调内的 shareType 对应参数
键值 | 类型 | 说明 |
---|---|---|
“0” | NSString | 未知,失败的时候可能会用到。 |
“WeChat” | NSString | 微信好友 |
“WeChatLine” | NSString | 微信朋友圈 |
“QQ” | NSString | QQ好友 |
“Qzone” | NSString | QQ空间 |
“SinaWeibo” | NSString | 新浪微博 |
“Facebook” | NSString | 脸书 |
“Twitter” | NSString | 推特 |
“System” | NSString | 系统 |
参数名 | 类型 | 重要性 | 说明 |
---|---|---|---|
OPSParam_ShareType | NSString | (必填) | OPShareText |
OPShareText | NSString | (必填) | 文本内容 |
参数名 | 类型 | 重要性 | 说明 |
---|---|---|---|
OPSParam_ShareType | NSString | (必填) | OPShareImage |
OPSParam_ImagePath | NSString | (必填) | 本地图片路径 |
参数名 | 类型 | 重要性 | 说明 |
---|---|---|---|
OPSParam_ShareType | NSString | (必填) | OPShareLink |
OPSParam_ImagePath | NSString | (必填) | 本地图片路径 |
OPSParam_Text | NSString | (必填) | 文本内容 |
OPSParam_LinkTitle | NSString | (必填) | 链接标题 |
OPSParam_LinkDesc | NSString | (必填) | 链接描述 |
OPSParam_LinkUrl | NSString | (必填) | 链接地址 |
回调示例(C++):
void ShareThirdPlatformCallBack(const char * shareType, int errCode, const char * jsonStr)
{
NSLog(@"ShareThirdPlatformCallBack");
string result = shareType;
if (errCode == 1) {
result.append("分享成功!");
}else if (errCode == 0){
result.append("分享取消!");
} else {
result.append("分享失败!");
}
cout<<errCode<<endl;
NSString *msg = [NSString stringWithUTF8String:result.c_str()];
NSLog(@"%@", msg);
UIAlertView*alert = [[UIAlertView alloc]initWithTitle:nil
message:msg
delegate:nil
cancelButtonTitle:nil
otherButtonTitles:@"确定",nil];
[alert show];
}
回调示例(OC):
- (void)ltShareThirdPlatformCallBackWithShareType:(NSString *)shareType errCode:(int)errCode dict:(NSDictionary *)dict {
if (errCode == 1) {
[[LTGameOCSDK shareInstance] LTSDKShowMessage:[NSString stringWithFormat:@"%@分享成功",shareType]];
}else if (errCode == 0){
[[LTGameOCSDK shareInstance] LTSDKShowMessage:[NSString stringWithFormat:@"%@分享取消",shareType]];
} else {
[[LTGameOCSDK shareInstance] LTSDKShowMessage:[NSString stringWithFormat:@"%@分享失败",shareType]];
}
}
样式示例:
调用示例(C++):
- (void)LTShareScene:(int) friendScene contentType:(int) type
{
//*************************分享************************************
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
if (type == 0) {
//分享文本
[dic setObject:OPShareText forKey:OPSParam_ShareType];
[dic setObject:@"test" forKey:OPSParam_Text];
}else if(type == 1){
//分享图片
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"res5" ofType:@"jpg"];
[dic setObject:OPShareImage forKey:OPSParam_ShareType];
[dic setObject:filePath forKey:OPSParam_ImagePath];
filePath = [[NSBundle mainBundle] pathForResource:@"res5" ofType:@"jpg"];
[dic setObject:filePath forKey:@"thumbImage"];//缩略图
}else{
//分享链接
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"res5" ofType:@"jpg"];
[dic setObject:OPShareLink forKey:OPSParam_ShareType];
[dic setObject:@"testTitle" forKey:OPSParam_LinkTitle];
[dic setObject:@"http://www.longtugame.com/" forKey:OPSParam_LinkUrl];
[dic setObject:@"testDesc" forKey:OPSParam_LinkDesc];
[dic setObject:filePath forKey:OPSParam_ImagePath];//多媒体内容中缩略图大小不能大于32K
}
LTGameSDK::GetInstance().ShareThirdPlatformView(dic, ShareThirdPlatformCallBack);
}
调用示例(OC):
- (void)LTShareScene:(int) friendScene contentType:(int) type
{
//*************************分享************************************
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
if (type == 0) {
//分享文本
[dic setObject:OPShareText forKey:OPSParam_ShareType];
[dic setObject:@"test" forKey:OPSParam_Text];
}else if(type == 1){
//分享图片
// NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"jpg"];
// [dic setObject:OPShareImage forKey:OPSParam_ShareType];
// [dic setObject:filePath forKey:OPSParam_ImagePath];
// filePath = [[NSBundle mainBundle] pathForResource:@"thumbImage" ofType:@"jpg"];
// [dic setObject:filePath forKey:@"thumbImage"];//缩略图
//分享图片
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareImage forKey:OPSParam_ShareType];
[dic setObject:filePath forKey:OPSParam_ImagePath];
}else{
//分享链接
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"jpg"];
[dic setObject:OPShareLink forKey:OPSParam_ShareType];
[dic setObject:@"testTitle" forKey:OPSParam_LinkTitle];
[dic setObject:@"http://pp.longtugame.com/apimob/ad? c=22690" forKey:OPSParam_LinkUrl];
[dic setObject:@"testDesc" forKey:OPSParam_LinkDesc];
[dic setObject:filePath forKey:OPSParam_ImagePath]; //多媒体内容中缩略图大小不能大于32K
}
[[LTGameOCSDK shareInstance] LTSDKShareThirdPlatformView:dic];
}
调用示例(C++):
// *************************微信分享************************************
- (void)weChatShareScene:(int) friendScene contentType:(int) type
{
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
if (type == 0) {
//分享文本
[dic setObject:OPShareText forKey:OPSParam_ShareType];
[dic setObject:@"test" forKey:OPSParam_Text];
}else if(type == 1){
//分享图片
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareImage forKey:OPSParam_ShareType];
[dic setObject:filePath forKey:OPSParam_ImagePath];
// [dic setObject:filePath forKey:@"thumbImage"];//缩略图
}else{
//分享链接
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareLink forKey:OPSParam_ShareType];
[dic setObject:@"testTitle" forKey:OPSParam_LinkTitle];
[dic setObject:@"http://www.longtugame.com/" forKey:OPSParam_LinkUrl];
[dic setObject:@"testDesc" forKey:OPSParam_LinkDesc];
[dic setObject:filePath forKey:OPSParam_ImagePath];
}
if (friendScene == 0) {
//好友分享
LTGameSDK::GetInstance().ShareThirdPlatform(SceneWeChat, dic,ShareThirdPlatformCallBack);
} else {
//朋友圈分享
LTGameSDK::GetInstance().ShareThirdPlatform(SceneWeChatLine, dic,ShareThirdPlatformCallBack);
}
}
// *************************QQ分享************************************
- (void)qqShareScene:(int)friendScene contentType:(int)type
{
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
if (type == 0) {
//分享文本
[dic setObject:OPShareText forKey:OPSParam_ShareType];
[dic setObject:@"文本测试" forKey:OPSParam_Text];
}else if(type == 1){
//分享图片
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareImage forKey:OPSParam_ShareType];
[dic setObject:filePath forKey:OPSParam_ImagePath];
// [dic setObject:filePath forKey:@"thumbImage"];//缩略图
}else{
//分享链接
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareLink forKey:OPSParam_ShareType];
[dic setObject:@"testTitle" forKey:OPSParam_LinkTitle];
[dic setObject:@"http://www.longtugame.com/" forKey:OPSParam_LinkUrl];
[dic setObject:@"testDesc" forKey:OPSParam_LinkDesc];
[dic setObject:filePath forKey:OPSParam_ImagePath];
}
// [dic setObject:@"NOAPPID" forKey:OPSParam_NOAPPID];
if (friendScene == 0) {
//好友分享
LTGameSDK::GetInstance().ShareThirdPlatform(SceneQQ, dic,ShareThirdPlatformCallBack);
} else {
//空间分享
LTGameSDK::GetInstance().ShareThirdPlatform(SceneQzone, dic,ShareThirdPlatformCallBack);
}
}
//*************************微博分享************************************
- (void)weiboShareContentType:(int)type
{
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
if (type == 0) {
//分享文本
[dic setObject:OPShareText forKey:OPSParam_ShareType];
[dic setObject:@"文本测试" forKey:OPSParam_Text];
} else if (type == 1) {
//分享图片
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareImage forKey:OPSParam_ShareType];
[dic setObject:filePath forKey:OPSParam_ImagePath];
} else {
//分享链接
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"thumbImage" ofType:@"jpg"];
[dic setObject:OPShareLink forKey:OPSParam_ShareType];
[dic setObject:@"testTitle" forKey:OPSParam_LinkTitle];
[dic setObject:@"http://www.longtugame.com/" forKey:OPSParam_LinkUrl];
[dic setObject:@"testDesc" forKey:OPSParam_LinkDesc];
[dic setObject:filePath forKey:OPSParam_ImagePath];
// [dic setObject:filePath forKey:@"thumbImage"]; //多媒体内容中缩略图大小不能大于32K
}
LTGameSDK::GetInstance().ShareThirdPlatform(SceneSinaWeibo, dic,ShareThirdPlatformCallBack);
}
// *************************Facebook分享************************************
- (void)facebookShareScene:(int)friendScene contentType:(int)type
{
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
if (type == 0) {
//分享文本 facebook不支持文本分享
}else if(type == 1){
//分享图片
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareImage forKey:OPSParam_ShareType];
[dic setObject:filePath forKey:OPSParam_ImagePath];
// [dic setObject:filePath forKey:@"thumbImage"];//缩略图
}else{
//分享链接
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareLink forKey:OPSParam_ShareType];
[dic setObject:@"testTitle" forKey:OPSParam_LinkTitle];
[dic setObject:@"http://www.longtugame.com/" forKey:OPSParam_LinkUrl];
[dic setObject:@"testDesc" forKey:OPSParam_LinkDesc];
[dic setObject:filePath forKey:OPSParam_ImagePath];
}
LTGameSDK::GetInstance().ShareThirdPlatform(SceneFacebook, dic,ShareThirdPlatformCallBack);
}
// *************************Twitter分享************************************
- (void)twitterShareScene:(int)friendScene contentType:(int)type
{
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
if (type == 0) {
//分享文本
[dic setObject:OPShareText forKey:OPSParam_ShareType];
[dic setObject:@"文本测试" forKey:OPSParam_Text];
}else if(type == 1){
//分享图片
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareImage forKey:OPSParam_ShareType];
[dic setObject:filePath forKey:OPSParam_ImagePath];
// [dic setObject:filePath forKey:@"thumbImage"];//缩略图
}else{
//分享链接
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareLink forKey:OPSParam_ShareType];
[dic setObject:@"testTitle" forKey:OPSParam_LinkTitle];
[dic setObject:@"http://www.longtugame.com/" forKey:OPSParam_LinkUrl];
[dic setObject:@"testDesc" forKey:OPSParam_LinkDesc];
[dic setObject:filePath forKey:OPSParam_ImagePath];
}
LTGameSDK::GetInstance().ShareThirdPlatform(SceneTwitter, dic,ShareThirdPlatformCallBack);
}
调用示例(OC):
// *************************微信分享************************************
- (void)weChatShareScene:(int) friendScene contentType:(int) type
{
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
if (type == 0) {
//分享文本
[dic setObject:OPShareText forKey:OPSParam_ShareType];
[dic setObject:@"test" forKey:OPSParam_Text];
}else if(type == 1){
//分享图片
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareImage forKey:OPSParam_ShareType];
[dic setObject:filePath forKey:OPSParam_ImagePath];
// [dic setObject:filePath forKey:@"thumbImage"];//缩略图
}else{
//分享链接
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareLink forKey:OPSParam_ShareType];
[dic setObject:@"testTitle" forKey:OPSParam_LinkTitle];
[dic setObject:@"http://www.longtugame.com/" forKey:OPSParam_LinkUrl];
[dic setObject:@"testDesc" forKey:OPSParam_LinkDesc];
[dic setObject:filePath forKey:OPSParam_ImagePath];
}
if (friendScene == 0) {
//好友分享
[[LTGameOCSDK shareInstance] LTSDKShareThirdPlatformWithChannel:SceneWeChat dict:dic];
} else {
//朋友圈分享
[[LTGameOCSDK shareInstance] LTSDKShareThirdPlatformWithChannel:SceneWeChatLine dict:dic];
}
}
// *************************QQ分享************************************
- (void)qqShareScene:(int)friendScene contentType:(int)type
{
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
if (type == 0) {
//分享文本
[dic setObject:OPShareText forKey:OPSParam_ShareType];
[dic setObject:@"文本测试" forKey:OPSParam_Text];
}else if(type == 1){
//分享图片
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareImage forKey:OPSParam_ShareType];
[dic setObject:filePath forKey:OPSParam_ImagePath];
// [dic setObject:filePath forKey:@"thumbImage"];//缩略图
}else{
//分享链接
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareLink forKey:OPSParam_ShareType];
[dic setObject:@"testTitle" forKey:OPSParam_LinkTitle];
[dic setObject:@"http://www.longtugame.com/" forKey:OPSParam_LinkUrl];
[dic setObject:@"testDesc" forKey:OPSParam_LinkDesc];
[dic setObject:filePath forKey:OPSParam_ImagePath];
}
// [dic setObject:@"NOAPPID" forKey:OPSParam_NOAPPID];
if (friendScene == 0) {
//好友分享
[[LTGameOCSDK shareInstance] LTSDKShareThirdPlatformWithChannel:SceneQQ dict:dic];
} else {
//朋友圈分享
[[LTGameOCSDK shareInstance] LTSDKShareThirdPlatformWithChannel:SceneQzone dict:dic];
}
}
//*************************微博分享************************************
- (void)weiboShareContentType:(int)type
{
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
if (type == 0) {
//分享文本
[dic setObject:OPShareText forKey:OPSParam_ShareType];
[dic setObject:@"文本测试" forKey:OPSParam_Text];
} else if (type == 1) {
//分享图片
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareImage forKey:OPSParam_ShareType];
[dic setObject:filePath forKey:OPSParam_ImagePath];
} else {
//分享链接
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"thumbImage" ofType:@"jpg"];
[dic setObject:OPShareLink forKey:OPSParam_ShareType];
[dic setObject:@"testTitle" forKey:OPSParam_LinkTitle];
[dic setObject:@"http://www.longtugame.com/" forKey:OPSParam_LinkUrl];
[dic setObject:@"testDesc" forKey:OPSParam_LinkDesc];
[dic setObject:filePath forKey:OPSParam_ImagePath];
// [dic setObject:filePath forKey:@"thumbImage"]; //多媒体内容中缩略图大小不能大于32K
}
[[LTGameOCSDK shareInstance] LTSDKShareThirdPlatformWithChannel:SceneSinaWeibo dict:dic];
}
// *************************Facebook分享************************************
- (void)facebookShareScene:(int)friendScene contentType:(int)type
{
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
if (type == 0) {
//分享文本 facebook不支持文本分享
}else if(type == 1){
//分享图片
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareImage forKey:OPSParam_ShareType];
[dic setObject:filePath forKey:OPSParam_ImagePath];
// [dic setObject:filePath forKey:@"thumbImage"];//缩略图
}else{
//分享链接
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareLink forKey:OPSParam_ShareType];
[dic setObject:@"testTitle" forKey:OPSParam_LinkTitle];
[dic setObject:@"http://www.longtugame.com/" forKey:OPSParam_LinkUrl];
[dic setObject:@"testDesc" forKey:OPSParam_LinkDesc];
[dic setObject:filePath forKey:OPSParam_ImagePath];
}
[[LTGameOCSDK shareInstance] LTSDKShareThirdPlatformWithChannel:SceneFacebook dict:dic];
}
// *************************Twitter分享************************************
- (void)twitterShareScene:(int)friendScene contentType:(int)type
{
NSMutableDictionary *dic = [[NSMutableDictionary alloc] init];
if (type == 0) {
//分享文本
[dic setObject:OPShareText forKey:OPSParam_ShareType];
[dic setObject:@"文本测试" forKey:OPSParam_Text];
}else if(type == 1){
//分享图片
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareImage forKey:OPSParam_ShareType];
[dic setObject:filePath forKey:OPSParam_ImagePath];
// [dic setObject:filePath forKey:@"thumbImage"];//缩略图
}else{
//分享链接
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"localPic" ofType:@"png"];
[dic setObject:OPShareLink forKey:OPSParam_ShareType];
[dic setObject:@"testTitle" forKey:OPSParam_LinkTitle];
[dic setObject:@"http://www.longtugame.com/" forKey:OPSParam_LinkUrl];
[dic setObject:@"testDesc" forKey:OPSParam_LinkDesc];
[dic setObject:filePath forKey:OPSParam_ImagePath];
}
[[LTGameOCSDK shareInstance] LTSDKShareThirdPlatformWithChannel:SceneTwitter dict:dic];
}
PS:两种分享共用同一回调接口.
需引入LTParam.h头文件
//***************分享场景*******************
#define SceneWeChat @"WeChat" //微信好友
#define SceneWeChatLine @"WeChatLine" //微信朋友圈
#define SceneQQ @"QQ" //QQ好友
#define SceneQzone @"Qzone" //QQ空间
#define SceneSinaWeibo @"SinaWeibo" //新浪微博
#define SceneFacebook @"Facebook" //Facebook
#define SceneTwitter @"Twitter" //Twitter
//***************分享参数********************
#define OPSParam_ShareType @"ShareType" //分享类型标识
#define OPShareText @"ShareText" //分享文本
#define OPShareImage @"ShareImage" //分享图片
#define OPShareLink @"ShareLink" //分享链接
#define OPSParam_Text @"Text" //文本
#define OPSParam_ImagePath @"ImagePath" //图片本地地址
#define OPSParam_LinkTitle @"LinkTitle" //链接标题
#define OPSParam_LinkDesc @"LinkDesc" //链接描述
#define OPSParam_LinkUrl @"LinkUrl" //链接地址
#define OPSParam_NOAPPID @"NOAPPID" //特殊参数,暂时无用
新版三方登录和分享支持URLlink,需增加实现生命周期方法接入
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler{
#if _AREA_FLAG & MASK_INIT_AREA_CPLUS//调用示例(C++):
if (LTGameSDK::GetInstance().ContinueUserActivity(application, userActivity, restorationHandler)) {
return YES;
}
#endif
#if _AREA_FLAG & MASK_INIT_AREA_OC//调用示例(OC):
if ([[LTGameOCSDK shareInstance] LTSDKApplication:application continueUserActivity:userActivity restorationHandler:restorationHandler]) {
return YES;
}
#endif
return NO;
}
(1)新浪微博支持分享类型:
a、应用内分享也就是网页分享支持: 文字,文字+图片,要分享链接需要链接添加在text里分享
b、客户端分享支持:文字,图片,文字+图片,图片+文字+链接
参数说明:
text:不能超过140个汉字
image:图片最大不超过5M,仅支持PNG格式
QQ好友分享支持:文字,图片,文字+图片+链接,音乐链接,视频链接
参数说明:
text:最多40个字符
title:最多30个字符,超出部分会被截断
url :URL 地址,最长 512 个字符
thumbImage:预览图数据,最大20k
image:最大1M,仅支持PNG格式
QQ空间分享支持:文字,图片,文字+图片+链接,本地视频,视频链接
参数说明:
url: 1、必须用域名网址 ; 2、url 不能含有中文;
title:最多200个字符;
text:最多600个字符;
微信好友分享支持:文字,图片,文字+图片+链接,音乐链接,视频链接,应用消息,表情,文件(本地视频),小程序
微信朋友圈分享支持:文字,图片,文字+图片+链接,音乐链接,视频链接
微信收藏分享支持:文字,图片,文字+图片+链接,音乐链接,视频链接,文件(本地视频)
参数说明
title:512Bytes以内
description:1KB以内
imageData:大小不能超过5M
imagePath:大小不能超过5M(传递的imagePath路径不能超过10KB)
imageUrl:长度不能超过10K(图片链接,仅支持PNG格式,较好的效果为大图360x200,小图200x200 )
ThumbImage:内存大小不能超过32K的png图,图片分享必须添加此图!!!!
musicUrl:长度不能超过10K
videoUrl:长度不能超过10K
url:不能为空且长度不能超过10K
参数说明
title:512Bytes以内
description:1KB以内
imageData:大小不能超过5M
imagePath:大小不能超过5M(传递的imagePath路径不能超过10KB)
imageUrl:长度不能超过10K(图片链接,仅支持PNG格式,较好的效果为大图360x200,小图200x200 )
ThumbImage:内存大小不能超过32K的png图,图片分享必须添加此图!!!!
musicUrl:长度不能超过10K
videoUrl:长度不能超过10K
url:不能为空且长度不能超过10K
分享支持:图片、链接,不支持分享文本
参数说明:
image:小于4M
分享支持:图片、文本、链接
参数说明:
image:小于4M
text:小于140字符
分享支持:图片,链接.
参数说明
1.经测试发现系统分享到QQ时图片大于100K的话QQ会有很大几率发送失败,其他渠道如果图片过大会导致加载过程极慢甚至卡死,不同渠道也不太一样,官方并没有具体文档说明,所以分享图片时最好尽可能压缩图片大小.
2.另外针对系统分享到Facebook和Twitter在系统iOS12的设备上会直接返回失败,经测试为苹果自己的bug,暂时无解,所以在iOS12 上系统分享到Facebook和Twitter无法正常使用.
3.Twitter在分享链接时如果带缩略图则自动变成图片分享,无法正常分享链接,Facebook则在分享链接时无论带不带缩略图都不会显示缩略图.所以建议海外版本在使用系统分享链接时建议不传缩略图.
上海中清龙图软件有限公司