From 4590e58305d7b4461e5f750c8d982e3f734114eb Mon Sep 17 00:00:00 2001 From: Ray Fang Date: Sat, 8 Mar 2014 16:37:11 +0800 Subject: [PATCH] if WeChat app is not installed, do not show --- WeixinActivity/WeixinActivityBase.m | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/WeixinActivity/WeixinActivityBase.m b/WeixinActivity/WeixinActivityBase.m index 0dd5bc1..70d015d 100644 --- a/WeixinActivity/WeixinActivityBase.m +++ b/WeixinActivity/WeixinActivityBase.m @@ -22,12 +22,14 @@ - (NSString *)activityType - (BOOL)canPerformWithActivityItems:(NSArray *)activityItems { - for (id activityItem in activityItems) { - if ([activityItem isKindOfClass:[UIImage class]]) { - return YES; - } - if ([activityItem isKindOfClass:[NSURL class]]) { - return YES; + if ([WXApi isWXAppInstalled] && [WXApi isWXAppSupportApi]) { + for (id activityItem in activityItems) { + if ([activityItem isKindOfClass:[UIImage class]]) { + return YES; + } + if ([activityItem isKindOfClass:[NSURL class]]) { + return YES; + } } } return NO;