Commit 01a81f1d authored by 王伟明's avatar 王伟明

Merge branch 'lwq7.37.0' into 'master'

fix 分享一张图片时添加客户端安装检查

See merge request !6
parents 4717a01e ba05d8b3
......@@ -45,7 +45,9 @@
+ (BOOL)isClientInstalled:(GMSharePlatform)platformType{
if (platformType == GMSharePlatformQQ) {
if (platformType == GMSharePlatformQQ ||
platformType == GMSharePlatformQQSpace ||
platformType == GMSharePlatformQQFriend) {
return [QQApiInterface isQQInstalled] ? YES : NO;
} else if ((platformType == GMSharePlatformWechatTimeline) | (platformType == GMSharePlatformWechatSession) | (platformType == GMSharePlatformWechat)) {
return [WXApi isWXAppInstalled] ? YES : NO;
......@@ -218,6 +220,13 @@
只分享一张图片
*/
- (void)shareImage:(UIImage *)image platform:(GMSharePlatform)platformType {
if (![GMShareSDK isClientInstalled:platformType]) {
NSString *platfomName = [self getPlatformNameWithType:platformType];
if (platfomName) {
[UIAlertController showgm_OKAlertWithTitle:@"提示" message:[NSString stringWithFormat:@"未安装%@",platfomName] actionTitle:@"取消" actionHandler:^{}];
return;
}
}
switch (platformType) {
case GMSharePlatformQQFriend: {
[self QQFriendShareWithImage:image];
......@@ -641,5 +650,23 @@
// req.mpInfo = [DouyinOpenSDKMPInfo mpInfoWithIdentifier:@"you_mp_identifier" title:@"title" desc:@"desc" startPageURL:nil];
}
- (NSString *)getPlatformNameWithType:(GMSharePlatform)platformType {
switch (platformType) {
case GMSharePlatformSinaWeibo:
return @"微博客户端";
case GMSharePlatformQQSpace:
return @"QQ客户端";
case GMSharePlatformQQFriend:
return @"QQ客户端";
case GMSharePlatformWechatSession:
return @"微信客户端";
case GMSharePlatformWechatTimeline:
return @"微信客户端";
default:
break;
}
return nil;
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment