Commit 445c92d9 authored by jz's avatar jz

add files

parent e206ca72
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
//
// GMAAA.swift
// GMAI_Example
//
// Created by Q14 on 2020/1/17.
// Copyright © 2020 Q14. All rights reserved.
//
import UIKit
class GMAAA: NSObject {
}
......@@ -8,7 +8,7 @@ source 'git@git.wanmeizhensuo.com:gengmeiios/GMSpecs.git'
target 'GMAI_Example' do
pod 'GMAI', :path => '../'
pod 'GMBaseSwift', '3.3.7'
# pod 'EVReflection', '5.10.0'
# pod 'GMAlbum', :path => '../../GMAlbum'
target 'GMAI_Tests' do
inherit! :search_paths
......
......@@ -15,6 +15,9 @@ PODS:
- AFNetworking/UIKit (3.1.0):
- AFNetworking/NSURLSession
- Alamofire (4.7.0)
- BDOpenSDKKit (1.0.0)
- DouyinOpenSDK (1.4.1):
- BDOpenSDKKit (~> 1.0.0)
- EVReflection (5.10.0):
- EVReflection/Core (= 5.10.0)
- EVReflection/Core (5.10.0)
......@@ -27,8 +30,13 @@ PODS:
- GMFoundation
- GMNetworking
- GMRouter
- GMShareSDK
- GMUtil
- lottie-ios
- ObjectMapper
- Qiniu
- SDWebImage
- SwiftyJSON
- GMBase (1.1.5):
- GMHud
- GMJSONModel
......@@ -106,17 +114,33 @@ PODS:
- MJRefresh
- GMRouter (0.1.5):
- MJExtension
- GMShareSDK (0.1.9):
- DouyinOpenSDK
- GMFoundation
- GMJSONModel
- GMKit
- GMPhobos
- Masonry
- MBProgressHUD (= 0.9.2)
- WechatOpenSDK
- WeiboSDK
- GMUtil (3.1.0)
- lottie-ios (2.5.3)
- Masonry (1.1.0)
- MBProgressHUD (0.9.2)
- MJExtension (3.2.1)
- MJRefresh (3.3.1)
- ObjectMapper (3.5.1)
- Qiniu (7.3.0)
- SDWebImage (5.4.2):
- SDWebImage/Core (= 5.4.2)
- SDWebImage/Core (5.4.2)
- SnapKit (4.0.0)
- SwiftyJSON (5.0.0)
- TMCache (2.1.0)
- "UITableView+FDTemplateLayoutCell (1.4)"
- WechatOpenSDK (1.8.6)
- WeiboSDK (3.1.3)
DEPENDENCIES:
- GMAI (from `../`)
......@@ -137,19 +161,28 @@ SPEC REPOS:
- GMPhobos
- GMRefresh
- GMRouter
https://github.com/cocoapods/specs.git:
- GMShareSDK
- GMUtil
https://github.com/CocoaPods/Specs.git:
- AFNetworking
- Alamofire
- BDOpenSDKKit
- DouyinOpenSDK
- EVReflection
- lottie-ios
- Masonry
- MBProgressHUD
- MJExtension
- MJRefresh
- ObjectMapper
- Qiniu
- SDWebImage
- SnapKit
- SwiftyJSON
- TMCache
- "UITableView+FDTemplateLayoutCell"
- WechatOpenSDK
- WeiboSDK
EXTERNAL SOURCES:
GMAI:
......@@ -158,9 +191,11 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
Alamofire: 907e0a98eb68cdb7f9d1f541a563d6ac5dc77b25
BDOpenSDKKit: 3fb530ce73f85a7d6ee69e7fd3d9158444c5bd09
DouyinOpenSDK: 5ba83de22963ba7a3ba70c8ff11dfcb2885ecc2b
EVReflection: 1abc1a81927ab0d30170238cf9b79bff489e9728
GM-Swift-Observable: 756d8fc13638b9faa68cb10266b2ffb47a911595
GMAI: 6dbdb0af8d3239093438c761e84f6ed88b5a53ad
GMAI: f5a23e34344e8894aa1503736f390ddb75780803
GMBase: 2b77f591a35a589ed331c490af093b68b0fc73be
GMBaseSwift: 168898c825ef16ffbf8bd261cb4b295cfb492bd2
GMCache: b78d8e46db864405e91d226ce640cc80d966c611
......@@ -173,16 +208,23 @@ SPEC CHECKSUMS:
GMPhobos: 1e2d68c456b69bf156276d7242877498107474db
GMRefresh: c01ff8de5ada92e1362602fb6991f99124b7dbe3
GMRouter: 808430d1275e92809eb1180ed3cb89525295da31
GMShareSDK: c17f8061727a86d7e070190c3d96032f7d9985af
GMUtil: 194a8831e4311762c4b1ac1278281b456157f4ec
lottie-ios: a50d5c0160425cd4b01b852bb9578963e6d92d31
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
MBProgressHUD: 1569cf7ace17a8bac47aabfbb8580a49690386d1
MJExtension: 635f2c663dcb1bf76fa4b715b2570a5710aec545
MJRefresh: eeda70fbf0ad277f3178cef1cd0c3532591d6237
ObjectMapper: 70187b8941977c62ccfb423caf6b50be405cabf0
Qiniu: a2fb1f87b40f52bc1f386d93c6d48aab09472eae
SDWebImage: 4ca2dc4eefae4224bea8f504251cda485a363745
SnapKit: a42d492c16e80209130a3379f73596c3454b7694
SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
"UITableView+FDTemplateLayoutCell": 234e1582bcc4e18461af91155123bb96538ed030
WechatOpenSDK: 368ae03b72ee3ea1328c4f11326fbb5d2721d118
WeiboSDK: acb067053668102cf07d01aa7604350162c2e466
PODFILE CHECKSUM: 841939c0a048be2edb77418fd6de6e35a738768b
PODFILE CHECKSUM: 431fca333b8ff7a1aeb6c26137d05d63bbb1d0fa
COCOAPODS: 1.7.4
COCOAPODS: 1.8.4
//
// DouyinOpenSDKApi.h
// 所有Api接口
//
// Created by 抖音短视频 on 18/9/2017.
// Copyright (c) 2018年 抖音短视频. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DouyinOpenSDKApiObject.h"
NS_ASSUME_NONNULL_BEGIN
@protocol DouyinOpenSDKApiDelegate <NSObject>
@optional
/**
接收并处理来自抖音短视频的请求消息
@param req 抖音短视频主动发送的具体请求内容
*/
- (void)didReceiveRequest:(DouyinOpenSDKBaseReq * _Nonnull)req;
/**
第三方应用程序通过sendReq向抖音短视频发送请求后,收到来自抖音短视频的响应
@param resp 抖音短视频回应的具体内容
*/
- (void)didReceiveResponse:(DouyinOpenSDKBaseResp * _Nonnull)resp;
@end
@protocol DouyinOpenSDKLogDelegate <NSObject>
/**
接收来自抖音短视频的日志,可供调试用
@param log 日志内容
*/
- (void)onLog:(NSString *)log;
@end
@interface DouyinOpenSDKApi : NSObject
/**
设置SDK日志代理,可供调试
同时仅允许存在一个日志代理,每次调用将覆盖之前的delegate
SDK会弱引用这个logDelegate
@param logDelegate 日志代理
*/
+ (void)registerLogDelegate:(id<DouyinOpenSDKLogDelegate>)logDelegate;
/**
清除SDK日志代理,停止调试
会清除之前设置的日志代理
*/
+ (void)unregisterLogDelegate;
/**
向抖音短视频注册第三方应用
需要在每次启动第三方应用程序时调用。第一次调用后,将添加到头条的可用应用列表中
@attention 必须在主线程执行
@param appId 第三方应用在抖音短视频开放平台申请的appId(appId也称ClientKey)
@return 成功返回YES,否则返回NO
*/
+ (BOOL)registerAppId:(NSString * _Nonnull)appId;
/**
处理抖音短视频通过URL启动第三方应用时传递的数据,需在[application:openURL:sourceApplication:annotation:]或者[application:handleOpenURL:]中调用
@attention 必须在主线程执行
@param url 启动第三方应用的URL
@param delegate DouyinOpenSDKApiDelegate对象,用来接收抖音短视频触发的消息
@return 成功处理返回YES,否则返回NO
*/
+ (BOOL)handleOpenURL:(NSURL * _Nonnull)url
delegate:(id<DouyinOpenSDKApiDelegate> _Nullable)delegate;
/**
获取当前SDK的版本
@return 返回SDK当前版本号
*/
+ (nonnull NSString *)currentVersion;
/**
判断用户是否安装了抖音短视频
@return 安装返回YES,否则返回NO
*/
+ (BOOL)isAppInstalled;
/**
判断当前抖音短视频版本是否支持授权登录
@return 支持返回YES,否则返回NO
*/
+ (BOOL)isAppSupportAuthorization;
/**
判断当前TOREPLACEPRODUCTNAME版本是否支持分享
@return 支持返回YES,否则返回NO
*/
+ (BOOL)isAppSupportShare;
/**
获取抖音短视频在iTunes上的下载地址
@return 返回抖音短视频的安装地址
*/
+ (nonnull NSString *)getAppiTunesUrl;
/**
由第三方APP给抖音短视频发送请求,抖音短视频处理完成后通过didReceiveResponse:回调
@attention 必须运行在主线程
@param req 发送给抖音短视频的请求
@return 发送请求成功返回YES,否则返回NO并终止流程
*/
+ (BOOL)sendReq:(DouyinOpenSDKBaseReq * _Nonnull)req;
/*! @brief 发送Auth请求,唤起抖音短视频客户端,若用户没安装抖音短视频则唤起web授权页,等待抖音短视频返回response
*
* 函数调用后,会切换到抖音短视频的界面。第三方应用程序等待抖音短视频返回response
* @param req 具体的发送请求,在调用函数后,请自己释放。
* @param viewController 当前界面对象,用于展示抖音短视频的web授权页。
* @param delegate DouyinOpenSDKApiDelegate对象,用来接收抖音短视频触发的消息。
* @return 成功返回YES,失败返回NO。
*/
+ (BOOL)sendAuthReq:(DouyinOpenSDKSendAuthReq*)req viewController:(UIViewController*)viewController delegate:(id<DouyinOpenSDKApiDelegate>)delegate;
/**
进行web授权页预加载缓存,针对web页展示慢做的优化,使授权请求中展示web页更快
若无需求可以不调用
@param req 预加载的授权请求
*/
+ (void)preloadWebAuthWithReq:(DouyinOpenSDKSendAuthReq *)req;
/**
清理web授权页预加载缓存
若无需求可以不调用
*/
+ (void)clearPreloadWebAuthCache;
/**
抖音短视频给第三方APP发送请求后,第三方APP通过didReceiveRequest:接收到请求后,第三方APP使用SendResp:给抖音短视频回送响应
@attention 必须运行在主线程
@param resp 回送给抖音短视频的响应
@return 发送请求成功返回YES,否则返回NO并终止流程
*/
+ (BOOL)sendResp:(DouyinOpenSDKBaseResp * _Nonnull)resp;
@end
NS_ASSUME_NONNULL_END
//
// DouyinOpenSDKApiObject.h
// Api对象,包含所有接口和对象数据定义
//
// Created by 抖音短视频 on 18/9/2017.
// Copyright (c) 2018年 抖音短视频. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, DouyinOpenSDKErrorCode) {
DouyinOpenSDKSuccess = 0, /** 成功 */
DouyinOpenSDKErrorCodeCommon = -1, /** 通用错误类型 <包括网络错误> */
DouyinOpenSDKErrorCodeUserCanceled = -2, /** 用户手动取消 */
DouyinOpenSDKErrorCodeSendFailed = -3, /** 发送失败 */
DouyinOpenSDKErrorCodeAuthDenied = -4, /** 权限错误 */
DouyinOpenSDKErrorCodeUnsupported = -5, /** 不支持 */
};
#pragma mark - DouyinOpenSDKBaseReq
@interface DouyinOpenSDKBaseReq : NSObject
@end
#pragma mark - DouyinOpenSDKSendAuthReq
/**
第三方程序向抖音短视频请求认证授权的消息结构
第三方程序向抖音短视频发送认证用户的某些权限的请求,抖音短视频处理完成后会向第三方回送一个处理结果。
*/
@interface DouyinOpenSDKSendAuthReq : DouyinOpenSDKBaseReq
/**
第三方应用程序向抖音短视频申请的必需权限类型,最终在抖音短视频App授权完成后根据实际授权结果返回给第三方应用;
例如 [NSOrderedSet orderedSetWithObjects:@"user_info", ..., nil]
*/
@property (nonatomic, strong, nullable) NSOrderedSet<NSString *> *permissions;
/**
第三方应用程序向抖音短视频申请的附加权限类型,用户可以勾选是否给予这部分权限,最终在抖音短视频App授权完成后根据实际授权结果返回给第三方应用;
@key permission 权限
@key defaultChecked 初始勾选状态,@"1"表示勾选,@"0"表示未勾选
例如 [NSOrderedSet orderedSetWithObjects:@{@"permission":@"user_info",@"defaultChecked":@"0"}, ..., nil]
*/
@property (nonatomic, strong, nullable) NSOrderedSet<NSDictionary<NSString *,NSString *> *> *additionalPermissions;
/**
第三方应用程序用来标识请求的唯一性,最后跳转回第三方程序时由抖音短视频App回传
*/
@property (nonatomic, copy, nullable) NSString *state;
@end
#pragma mark - DouyinOpenSDKBaseResp
@interface DouyinOpenSDKBaseResp : NSObject
/**
错误码
*/
@property (nonatomic, assign) DouyinOpenSDKErrorCode errCode;
/**
错误描述
*/
@property (nonatomic, copy, nullable) NSString *errString;
@end
#pragma mark - DouyinOpenSDKSendAuthResp
/**
抖音短视频处理完成第三方应用的认证与权限申请后,回送给第三方应用的处理结果。
第三方程序向抖音短视频申请权限认证,需要调用DouyinOpenSDKApi的[sendAuthReq:viewController:delegate:]函数,向抖音短视频发送DouyinOpenSDKSendAuthReq的请求,抖音短视频处理完成后会向第三方回送一个DouyinOpenSDKSendAuthResp对象的响应。
*/
@interface DouyinOpenSDKSendAuthResp : DouyinOpenSDKBaseResp
/**
第三方应用向抖音短视频申请某些权限,最终在抖音短视频App授权完成后根据实际授权结果返回给第三方应用
*/
@property (nonatomic, copy, readonly, nullable) NSString *code;
/**
第三方应用程序用来标识请求的唯一性,最后跳转回第三方程序时由抖音短视频回传
*/
@property (nonatomic, copy, readonly, nullable) NSString *state;
/**
抖音短视频用户同意给予第三方应用程序的权限,若授权成功则包括全部必需权限和用户勾选的附加权限;
*/
@property (nonatomic, strong, nullable) NSOrderedSet<NSString *> *grantedPermissions;
@end
#pragma mark - DouyinOpenSDKShareReq
/**
分享捆绑抖音小程序相关信息数据结构
*/
@interface DouyinOpenSDKMPInfo : NSObject
@property (nonatomic, copy) NSString *identifier;
@property (nonatomic, copy, nullable) NSString *title;
@property (nonatomic, copy, nullable) NSString *desc;
@property (nonatomic, copy, nullable) NSString *startPageURL;
+ (DouyinOpenSDKMPInfo *)mpInfoWithIdentifier:(NSString *)identifier
title:(nullable NSString *)title
desc:(nullable NSString *)desc
startPageURL:(nullable NSString *)startPageURL;
@end
typedef NS_ENUM(NSUInteger, DouyinOpenSDKShareMediaType) {
DouyinOpenSDKShareMediaTypeImage = 0, // 对应 PHAssetMediaTypeImage
DouyinOpenSDKShareMediaTypeVideo, // 对应 PHAssetMediaTypeVideo
};
@interface DouyinOpenSDKShareReq : DouyinOpenSDKBaseReq
/**
第三方应用程序向抖音短视频分享的视频或图片在 **相册** 中的中的local identifier,上限为12个,内容须全部为图片,或者全部为视频。
若内容为视频,视频总时长应该大于3s;
图片的宽高比应满足:1/2.2<=宽高比<=2.2;
视频分辨率应满足:1/2.2<=宽高像素比<=2.2;
请三方应用程序自行检查分享的内容是否满足要求;
此处需注意,带品牌logo或品牌水印的视频,会命中抖音的审核逻辑,有比较大的概率导致分享视频推荐降权处理/分享视频下架处理/分享账号被封禁处理,请予以重视;
强烈建议第三方应用自行处理好分享内容中的不合规水印。
*/
@property (nonatomic, strong) NSArray *localIdentifiers;
/**
urlPaths在相册中对应的Media类型,urlPaths里面的必须都是同一种类型
*/
@property (nonatomic, assign) DouyinOpenSDKShareMediaType mediaType;
/**
第三方应用程序用来标识请求的唯一性,最后跳转回第三方程序时由抖音短视频App回传
*/
@property (nonatomic, copy, nullable) NSString *state;
/**
对应视频的 #话题 功能,需要额外申请权限,字符长度不能超过 35
*/
@property (nonatomic, copy, nullable) NSString *hashtag;
/**
对应的小程序信息
*/
@property (nonatomic, strong, nullable) DouyinOpenSDKMPInfo *mpInfo;
@end
#pragma mark - DouyinOpenSDKShareResp
/**
抖音短视频完成视频分享处理后,给第三方应用的处理结果。
*/
@interface DouyinOpenSDKShareResp : DouyinOpenSDKBaseResp
/**
第三方应用程序用来标识请求的唯一性,最后跳转回第三方程序时由抖音短视频回传
*/
@property (nonatomic, copy, readonly, nullable) NSString *state;
@end
NS_ASSUME_NONNULL_END
//
// ALPlatformView.h
// GMAlpha
//
// Created by Mikasa on 2019/1/10.
// Copyright © 2019 Gengmei. All rights reserved.
//
#import "GMThirdPartyDefine.h"
@interface ALPlatformView : UIView
@property (nonatomic, copy) void(^sharePlatformClick)(GMSharePlatform platform);
@end
//
// ALPlatformView.m
// GMAlpha
//
// Created by Mikasa on 2019/1/10.
// Copyright © 2019 Gengmei. All rights reserved.
//
#import "ALPlatformView.h"
#import "ALShareButton.h"
#import "GMShareSDK.h"
#import <GMKit/GMLabel.h>
#import <GMKit/UIColor+GMTheme.h>
#import <GMFoundation/NSString+GM.h>
#import <Masonry/Masonry.h>
#import <GMKit/GMButton.h>
#import <GMKit/Constant.h>
#import <MBProgressHUD/MBProgressHUD.h>
#import <GMThirdPartyDefine.h>
@interface ALPlatformView()
@property (nonatomic, strong) NSArray *platformArray;
@end
@implementation ALPlatformView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self addDefaultPlatform];
}
return self;
}
// 添加
- (void)addDefaultPlatform {
self.platformArray = @[@(GMSharePlatformWechatSession),
@(GMSharePlatformWechatTimeline),
@(GMSharePlatformQQFriend),
@(GMSharePlatformSinaWeibo)];
[self addPlatformTypeSubView];
}
#pragma mark - addSinInTypeSubView
- (void)addPlatformTypeSubView {
for (NSNumber *type in self.platformArray) {
[self addSinInType:[type integerValue]];
}
NSInteger count = self.subviews.count;
CGFloat space = (MAINSCREEN_WIDTH - (self.subviews.count * kALShareButtonW))/(self.subviews.count +1);
__weak __typeof(self)weakSelf = self;
for (int i = 0; i < count; i++) {
ALShareButton *button = self.subviews[i];
if (i == 0) {
[button mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(weakSelf.mas_centerY);
make.left.mas_equalTo(space);
make.size.mas_equalTo(CGSizeMake(kALShareButtonW, kALShareButtonH));
}];
} else {
ALShareButton *prebutton = self.subviews[i-1];
[button mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(weakSelf.mas_centerY);
make.size.mas_equalTo(CGSizeMake(kALShareButtonW, kALShareButtonH));
make.left.mas_equalTo(prebutton.mas_right).offset(space);
}];
}
}
}
- (void)addSinInType:(GMSharePlatform)type {
NSString *iconString = @"";
NSString *title = @"";
switch (type) {
case GMSharePlatformWechatSession:
{
iconString = @"share_weixin_session";
title = @"微信";
}
break;
case GMSharePlatformSinaWeibo:
{
iconString = @"share_sina_weibo";
title = @"微博";
}
break;
case GMSharePlatformWechatTimeline:
{
iconString = @"share_weixin_timeline";
title = @"朋友圈";
}
break;
case GMSharePlatformQQFriend:
{
iconString = @"share_qq";
title = @"QQ";
}
break;
default:
break;
}
ALShareButton *button = [[ALShareButton alloc] init];
button.tag = 1000 + type;
[button setImage:[UIImage imageNamed:iconString] forState:UIControlStateNormal];
[button setImage:[UIImage imageNamed:iconString] forState:UIControlStateHighlighted];
[button setTitle:title forState:UIControlStateNormal];
[button addTarget:self action:@selector(sinInTypeClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:button];
}
// 其他平台
- (void)sinInTypeClick:(GMButton *)sender {
GMSharePlatform platform = sender.tag - 1000;
if (![GMShareSDK isClientInstalled:platform] &&
(platform == GMSharePlatformWechatTimeline | platform == GMSharePlatformWechatSession)) {
//QQ和新浪支持web分享,只有微信不支持,这里优化下提示语
[self toast:@"您未安装微信客户端"];
return;
}
if (self.sharePlatformClick) {
self.sharePlatformClick(platform);
}
}
/** * @brief 分享结果提示*/
- (void)toast:(NSString *)text{
// [_hud hide:YES];
MBProgressHUD *hudProgrss = [MBProgressHUD showHUDAddedTo:[UIApplication sharedApplication].keyWindow animated:YES];
hudProgrss.mode = MBProgressHUDModeText;
hudProgrss.userInteractionEnabled = NO;
hudProgrss.labelText = text;
hudProgrss.removeFromSuperViewOnHide = YES;
[hudProgrss hide:YES afterDelay:1.0];
}
@end
//
// ALShareButton.h
// GMAlpha
//
// Created by Mikasa on 2019/1/10.
// Copyright © 2019 Gengmei. All rights reserved.
//
#define kShareImageWH 45
#define kALShareButtonW 48
#define kALShareButtonH (kShareImageWH + 19 + 5)
@interface ALShareButton : UIButton
@end
//
// ALShareButton.m
// GMAlpha
//
// Created by Mikasa on 2019/1/10.
// Copyright © 2019 Gengmei. All rights reserved.
//
#import "ALShareButton.h"
#import <GMKit/UIColor+GMTheme.h>
#import <GMKit/GMFont.h>
@implementation ALShareButton
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setTitleColor:RGBCOLOR_HEX(0x323232) forState:UIControlStateNormal];
self.titleLabel.font = [UIFont gmFont:13];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
}
return self;
}
- (CGRect)imageRectForContentRect:(CGRect)contentRect {
return CGRectMake((kALShareButtonW - kShareImageWH)/2, 0, kShareImageWH, kShareImageWH);
}
- (CGRect)titleRectForContentRect:(CGRect)contentRect {
return CGRectMake(0, kShareImageWH + 5, kALShareButtonW, 19);
}
@end
//
// ALShareTopicCardView.h
// GMAlpha
//
// Created by Mikasa on 2019/2/25.
// Copyright © 2019 Gengmei. All rights reserved.
//
#import <GMKit/GMLabel.h>
#import <GMKit/GMImageView.h>
#import <GMKit/GMView.h>
@interface ALShareTopicCardView : GMView
@property (nonatomic, strong) GMImageView *cardImageView;
@property (nonatomic, strong) GMLabel *cardTitleLabel;
@end
//
// ALShareTopicCardView.m
// GMAlpha
//
// Created by Mikasa on 2019/2/25.
// Copyright © 2019 Gengmei. All rights reserved.
//
#import "ALShareTopicCardView.h"
#import <GMKit/GMFont.h>
#import <GMKit/Constant.h>
#import <GMKit/UIColor+GMTheme.h>
#define kTopicCardViewW (MAINSCREEN_WIDTH - 30)
@interface ALShareTopicCardView ()
@end
@implementation ALShareTopicCardView
- (GMImageView *)cardImageView {
if (!_cardImageView) {
GMImageView *cardImageView = [GMImageView new];
cardImageView.contentMode = UIViewContentModeScaleAspectFit;
_cardImageView = cardImageView;
}
return _cardImageView;
}
- (GMLabel *)cardTitleLabel {
if (!_cardTitleLabel) {
GMLabel *cardTitleLabel = [GMLabel new];
cardTitleLabel.font = [UIFont gmFont:15];
cardTitleLabel.textColor = RGBCOLOR_HEX(0x323232);
cardTitleLabel.numberOfLines = 3;
_cardTitleLabel = cardTitleLabel;
}
return _cardTitleLabel;
}
- (void)setup {
[super setup];
self.backgroundColor = UIColor.whiteColor;
[self addSubview:self.cardImageView];
[self addSubview:self.cardTitleLabel];
[self addSetupContraints];
}
- (void)addSetupContraints {
CGFloat cardImageViewWH = (kTopicCardViewW - 20);
[self.cardImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.top.mas_equalTo(10);
make.height.width.mas_equalTo(cardImageViewWH);
}];
[self.cardTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(_cardImageView.mas_bottom).offset(10);
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.bottom.mas_equalTo(-18);
}];
}
@end
//
// GMDiaryShareInfoView.h
// Gengmei
//
// Created by yefengming on 2018/12/20.
// Copyright © 2018年 更美互动信息科技有限公司. All rights reserved.
//
#import <GMKit/GMLabel.h>
#import <GMKit/GMButton.h>
@interface GMDiaryShareInfoView : UIView
@property (nonatomic, strong) GMLabel *diaryNameLabel;
@property (nonatomic, strong) GMButton *shareButton;
@property (nonatomic, copy) void (^shareClickedBlcok)(void);
@end
//
// GMDiaryShareInfoView.m
// Gengmei
//
// Created by yefengming on 2018/12/20.
// Copyright © 2018年 更美互动信息科技有限公司. All rights reserved.
//
#import "GMDiaryShareInfoView.h"
#import <GMKit/UIColor+GMTheme.h>
#import <Masonry/Masonry.h>
#import <GMKit/Constant.h>
@implementation GMDiaryShareInfoView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor whiteColor];
self.diaryNameLabel = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0x333333) fontSize:15];
[self addSubview:self.diaryNameLabel];
self.shareButton = [[GMButton alloc] init];
[self.shareButton setImage:[UIImage imageNamed:@"share_diary"] forState:UIControlStateNormal];
[self.shareButton setImage:[UIImage imageNamed:@"share_diary"] forState:UIControlStateHighlighted];
[self.shareButton addTarget:self action:@selector(shareButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:self.shareButton];
[self.diaryNameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.height.mas_equalTo(15);
make.centerY.mas_equalTo(self.shareButton);
make.width.mas_equalTo(MAINSCREEN_WIDTH - 99);
}];
[self.shareButton mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-20);
make.top.mas_equalTo(14);
}];
}
return self;
}
- (void)shareButtonClick:(UIButton *)sender {
if (self.shareClickedBlcok) {
self.shareClickedBlcok();
}
}
@end
//
// GMDiaryShareView.h
// Gengmei
//
// Created by yefengming on 2018/12/19.
// Copyright © 2018年 更美互动信息科技有限公司. All rights reserved.
//
#import "GMShareTopView.h"
#import "GMShareSDK.h"
#import "WMShareObject.h"
@class GMShareView;
@protocol GMDiaryShareViewDelegate <NSObject>
@optional
/** @brief 定制分享定制内容*/
- (NSMutableDictionary *)fetchSharePublishContent:(GMSharePlatform)shareType;
/** 分享成功 */
- (void)shareResponseSuccess;
/** @brief 分享日记的shareObject*/
- (void)shareObject:(WMShareObject *)object;
@end
@interface GMDiaryShareView : GMView
/**
连续签到,补签任务
*/
@property (nonatomic, strong) GMShareTopView *topView;
@property (nonatomic, weak) id<GMDiaryShareViewDelegate> delegate;
/** @brief 显示分享界面*/
- (void)showWithShareArr:(NSMutableArray *)shareArr;
/** @brief 隐藏分享界面。最后会remove super view*/
- (void)hideShareView;
@end
//
// GMShareBaseObject.h
// GMShareSDK
//
// Created by Q14 on 2019/12/24.
//
#import <GMJSONModel/JSONModel.h>
@interface GMShareBaseObject : JSONModel
@end
//
// GMShareBaseObject.m
// GMShareSDK
//
// Created by Q14 on 2019/12/24.
//
#import "GMShareBaseObject.h"
@implementation GMShareBaseObject
@end
//
// WMShareCellCollectionViewCell.h
// Gengmei
//
// Created by Sean Lee on 1/23/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GMThirdPartyDefine.h"
typedef void (^TransferResponseChainBlock) (void);
@class GMButton;
@interface GMShareCell : UICollectionViewCell<UIGestureRecognizerDelegate>
@property (nonatomic, strong) UIButton * shareButton;
/**
* @brief 因为使用了button来布局,这样cell的高亮处理方便些。所以这里用一个block进行响应链传递,手动执行collectionView的didselect方法
*/
@property (nonatomic, copy) TransferResponseChainBlock transferResponseChainBlock;
@property (nonatomic, assign) GMSharePlatform shareType;
@end
//
// WMShareCellCollectionViewCell.m
// Gengmei
//
// Created by Sean Lee on 1/23/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import "GMShareCell.h"
#import "GMShareFlowLayout.h"
#import <GMKit/GMFont.h>
#import <GMKit/UIColor+GMTheme.h>
#import <GMFoundation/NSString+GM.h>
@implementation GMShareCell
- (instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
_shareButton = [UIButton buttonWithType:UIButtonTypeCustom];
_shareButton.titleLabel.font = [UIFont gmFont:12];
[_shareButton setTitleColor:UIColor.auxiliaryTextLight forState:UIControlStateNormal];
[_shareButton setTitle:@"好友QQ" forState:UIControlStateNormal];
[_shareButton setImage:[UIImage imageNamed:@"share_weixin_session"] forState:UIControlStateNormal];
[_shareButton addTarget:self action:@selector(shareButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
[_shareButton sizeToFit];
[self.contentView addSubview:_shareButton];
//图片是40x40
_shareButton.frame = CGRectMake(0, 0, SHARE_BUTTON_WIDTH, SHARE_BUTTON_HEIGHT);
_shareButton.userInteractionEnabled = YES;
//设置图片居上,文字居下
CGFloat spacing = 15;
CGSize imageSize = _shareButton.currentImage.size;
CGSize titleSize = [_shareButton.currentTitle sizeWithFont:[UIFont gmFont:12] boundSize:CGSizeMake(_shareButton.frame.size.width, CGFLOAT_MAX)];
CGFloat totalHeight = (imageSize.height + titleSize.height + spacing);
_shareButton.imageEdgeInsets = UIEdgeInsetsMake(- (titleSize.height), (SHARE_BUTTON_WIDTH - imageSize.width)/2, 0.0, 0.0);
_shareButton.titleEdgeInsets = UIEdgeInsetsMake(0.0, - (imageSize.width), - (totalHeight - titleSize.height),0.0);
}
return self;
}
- (void)shareButtonClicked:(UIButton *)button{
if (self.transferResponseChainBlock) {
self.transferResponseChainBlock();
}
}
@end
//
// WMShareCollectionViewFlowLayout.h
// Gengmei
//
// Created by Sean Lee on 1/23/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import <UIKit/UIKit.h>
#define SHARE_BUTTON_HEIGHT 70
#define SHARE_BUTTON_WIDTH 50
//#define COLLECTIONVIEW_HEIGHT 236
@interface GMShareFlowLayout : UICollectionViewFlowLayout
@end
//
// WMShareCollectionViewFlowLayout.m
// Gengmei
//
// Created by Sean Lee on 1/23/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import "GMShareFlowLayout.h"
#import <GMKit/Constant.h>
@implementation GMShareFlowLayout
-(void)prepareLayout{
[super prepareLayout];
self.minimumLineSpacing = 30;
self.itemSize = CGSizeMake(50, 70);
self.sectionInset = UIEdgeInsetsMake(20, 24, 20, 24);
self.minimumInteritemSpacing = floor((MAINSCREEN_WIDTH - SHARE_BUTTON_WIDTH*5 - self.sectionInset.left - self.sectionInset.right)/4);
[self setScrollDirection:UICollectionViewScrollDirectionVertical];
}
@end
//
// GMShareTopView.h
// Gengmei
//
// Created by yefengming on 2018/12/19.
// Copyright © 2018年 更美互动信息科技有限公司. All rights reserved.
//
#import <GMKit/GMView.h>
//#import <GMKit/GMButton.h>
@interface GMShareTopView : GMView
- (void)setName:(NSString *)name title:(NSString *)title subTitle:(NSString *)subTitle;
- (void)onlyTitle:(NSString *)title;
- (void)updateSubtitleConstraintsWithBottom:(CGFloat)bottom;
@end
//
// GMShareTopView.m
// Gengmei
//
// Created by yefengming on 2018/12/19.
// Copyright © 2018年 更美互动信息科技有限公司. All rights reserved.
//
#import "GMShareTopView.h"
#import <GMKit/GMLabel.h>
#import <GMKit/UIColor+GMTheme.h>
#import <GMFoundation/NSString+GM.h>
#import <GMKit/GMFont.h>
@interface GMShareTopView () {
GMLabel *_leftLabel;
GMLabel *_rightLabel;
}
@property (nonatomic, strong) GMLabel *nameLabel;
@property (nonatomic, strong) GMLabel *titleLabel;
@property (nonatomic, strong) GMLabel *subTitleLabel;
@end
@implementation GMShareTopView
- (instancetype)init
{
self = [super init];
if (self) {
self.layer.cornerRadius = 11;
self.layer.masksToBounds = YES;
self.backgroundColor = [UIColor whiteColor];
self.nameLabel = [GMLabel labelWithTextColor:RGBCOLOR_HEX(0x333333) fontSize:16];
self.nameLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.nameLabel];
self.titleLabel = [GMLabel labelWithTextColor:UIColor.auxiliaryTextLight fontSize:13];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.titleLabel];
self.subTitleLabel = [GMLabel labelWithTextColor:[UIColor colorWithHexString:@"FF7690"] fontSize:13];
self.subTitleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.subTitleLabel];
_leftLabel = [[GMLabel alloc] init];
_leftLabel.backgroundColor = UIColor.separatorLine;
[self addSubview:_leftLabel];
_rightLabel = [[GMLabel alloc] init];
_rightLabel.backgroundColor = UIColor.separatorLine;
[self addSubview:_rightLabel];
}
return self;
}
- (void)setSubViewsConstraints {
[self.nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(24);
make.height.mas_equalTo(16);
make.left.mas_equalTo(10);
make.right.mas_equalTo(-10);
}];
[self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(12);
make.height.mas_equalTo(13);
make.left.right.mas_equalTo(self.nameLabel);
}];
[self.subTitleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(7);
make.height.mas_equalTo(13);
make.bottom.mas_equalTo(-11);
make.left.right.mas_equalTo(self.nameLabel);
}];
}
- (void)setName:(NSString *)name title:(NSString *)title subTitle:(NSString *)subTitle {
self.nameLabel.text = name;
self.titleLabel.text = title;
self.subTitleLabel.text = subTitle;
[self setSubViewsConstraints];
if (!title.isNonEmpty && !subTitle.isNonEmpty) {
[self.nameLabel mas_updateConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(-11);
}];
} else if (title.isNonEmpty && !subTitle.isNonEmpty) {
[self.titleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(-11);
}];
} else if (!title.isNonEmpty && subTitle.isNonEmpty) {
[self.subTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(11);
}];
}
}
- (void)onlyTitle:(NSString *)title {
self.titleLabel.text = title;
self.titleLabel.textColor = UIColor.auxiliaryTextDark;
self.titleLabel.font = [UIFont gmFont:16];
self.layer.cornerRadius = 0;
[self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(28);
make.centerX.mas_equalTo(0);
make.height.mas_equalTo(16);
make.bottom.mas_equalTo(0);
}];
[_leftLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(_titleLabel);
make.right.mas_equalTo(_titleLabel.mas_left).offset(-8);
make.height.mas_equalTo(1);
make.width.mas_equalTo(15);
}];
[_rightLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(_titleLabel);
make.left.mas_equalTo(_titleLabel.mas_right).offset(8);
make.height.mas_equalTo(1);
make.width.mas_equalTo(15);
}];
}
- (void)updateSubtitleConstraintsWithBottom:(CGFloat)bottom {
[self.subTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(bottom);
}];
}
@end
//
// GMTestSkinAnimationWebView.h
// GMShareVideoAlertView.h
// Gengmei
//
// Created by 刘鹿杰 on 2019/8/21.
// Created by 朱璇 on 2019/8/3.
// Copyright © 2019 更美互动信息科技有限公司. All rights reserved.
//
NS_ASSUME_NONNULL_BEGIN
typedef void(^GMShareVideoAlertViewBlcok)();
@interface GMTestSkinAnimationWebView : WMBaseViewController
// 需要上传到七牛的图片
@property (nonatomic, strong) UIImage *image;
@interface GMShareVideoAlertView : UIView
// 出现提示窗
+ (instancetype)showNoticeAtertViewWithConfirmBtnClickBlock:(GMShareVideoAlertViewBlcok)confirmBtnClickBlock;
@end
......
//
// GMShareVideoAlertView.m
// Gengmei
//
// Created by 朱璇 on 2019/8/3.
// Copyright © 2019 更美互动信息科技有限公司. All rights reserved.
//
#import "GMShareVideoAlertView.h"
#import <Masonry/Masonry.h>
@interface GMShareVideoAlertView()
@property (nonatomic, copy) GMShareVideoAlertViewBlcok block;
@end
@implementation GMShareVideoAlertView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor colorWithWhite:0 alpha:.6];
[self setupSubviews];
}
return self;
}
- (void)setupSubviews {
UIImageView *background = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"share_wechatline_video_bg"]];
background.contentMode = UIViewContentModeScaleAspectFill;
[self addSubview:background];
CGFloat statusBarHeight = [[UIApplication sharedApplication] statusBarFrame].size.height;
[background mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(45);
make.right.mas_equalTo(-45);
make.top.mas_equalTo(93 + statusBarHeight);
make.bottom.mas_equalTo(-81 - self.safeAreaInsetsBottom);
}];
UIButton *confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[confirmBtn setBackgroundImage:[UIImage imageNamed:@"share_wechatline_video"] forState:UIControlStateNormal];
[confirmBtn setBackgroundImage:[UIImage imageNamed:@"share_wechatline_video"] forState:UIControlStateNormal | UIControlStateHighlighted];
[confirmBtn addTarget:self action:@selector(didClickConfirm) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:confirmBtn];
[confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(81, 35));
make.centerX.mas_equalTo(self.mas_centerX);
make.bottom.mas_equalTo(self.mas_bottom).offset(-50 - self.safeAreaInsetsBottom);
}];
}
+ (instancetype)showNoticeAtertViewWithConfirmBtnClickBlock:(GMShareVideoAlertViewBlcok)confirmBtnClickBlock {
UIView *backView = (UIView *)[[UIApplication sharedApplication] delegate];
GMShareVideoAlertView *alertView = [[GMShareVideoAlertView alloc] initWithFrame:backView.window.bounds];
alertView.block = confirmBtnClickBlock;
[backView.window addSubview:alertView];
return alertView;
}
- (void)didClickConfirm {
[self removeFromSuperview];
if (self.block) {
self.block();
}
}
- (CGFloat)safeAreaInsetsBottom {
if (@available(iOS 11.0, *)) {
return [UIApplication sharedApplication].keyWindow.safeAreaInsets.bottom;
} else {
return 0;
}
}
@end
//
// WMShareView.h
// Gengmei
//
// Created by Sean Lee on 1/22/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "GMShareCell.h"
#import "GMShareTopView.h"
#import "WMShareObject.h"
@class GMShareView;
@class GMCollectionView;
@protocol GMShareViewDelegate <NSObject>
@required
/**
* @brief 在shareView add到super view前,会调用该deleage,在这个delegate里配置shareView,比如hasFav、showDelete等属性配置
*
*/
- (void)willShowShareView:(GMShareView *)shareView;
@optional
/** @brief 定制分享定制内容*/
- (NSMutableDictionary *)fetchSharePublishContent:(GMSharePlatform)shareType;
/** @brief 删除*/
- (void)deleteContent;
/** @brief 收藏*/
- (void)shareView:(GMShareView *)shareView favriteContentWithIndexPath:(NSIndexPath *)indexPath;
/** @brief 刷新H5*/
- (void)refreshWebView;
/** @brief 举报*/
- (void)showReport;
/*** @brief 复制链接*/
- (void)copyShareUrl;
/*** @brief 取消关注圈子*/
- (void)unFollowZone;
/*** @brief 邀请回复(问题详情和回复详情界面)*/
- (void)inviteAnswer;
// 如果需要动态变化businessId,就实现这个方法
- (NSString *)shareViewNeedBusinessId;
/** 分享成功 */
- (void)shareResponseSuccess;
/** 分享视频 */
- (void)shareVideo:(GMSharePlatform)shareType;
/** 取消分享 */
- (void)cancleShareView;
@end
/**
* @brief 弹出通用分享、收藏、等工具视图。可以包含的功能还有圈子的关注、取消关注、举报,刷新等。具体见属性注释。
@note
使用 shareView 初始化,但返回的并不是一个单例
*/
@interface GMShareView : GMView
@property (nonatomic, weak) id<GMShareViewDelegate> delegate;
/** @brief collectionView*/
@property (nonatomic,strong) GMCollectionView * shareCollectionView;
/** @brief 整个中间的背景View */
@property (nonatomic, strong) GMView *bgView;
/** @brief 是否收藏过 */
@property (assign, nonatomic) BOOL hasFav;
/** @brief 是否显示微信快照和朋友圈快照。默认NO*/
@property (assign, nonatomic) BOOL showScreenshot;
/** @brief 是否显示收藏项目。默认NO*/
@property (assign, nonatomic) BOOL showFavor;
/** @brief 是否显示删除帖子。 默认NO*/
@property (assign, nonatomic) BOOL showDelete;
/** @brief 是否显示举报帖子。 默认NO*/
@property (assign, nonatomic) BOOL showReport;
/** @brief 是否显示取消关注(用于圈子的取消关注)默认NO*/
@property (assign, nonatomic) BOOL showCancelFollow;
/** @brief 是否显示拷贝H5链接 默认YES*/
@property (nonatomic, assign) BOOL showCopyLink;
/** @brief 是否显示用于H5的刷新 默认YES*/
@property (nonatomic, assign) BOOL showRefresh;
/** @brief 是否显示邀请回复 默认NO*/
@property (nonatomic, assign) BOOL showInviteAnswer;
/** @brief 分享文案标题*/
@property (nonatomic, strong) NSString *shareTitle;
/** 分享url, 用于直接点击分享(没弹窗形式) */
@property (nonatomic, copy) NSString *shareUrl;
@property (nonatomic, strong) GMView *topLineView;
/**
连续签到,补签任务
*/
@property (nonatomic, strong) GMShareTopView *topView;
/**
分享:share 分享邀请好友注册:sharefor_register
*/
@property (nonatomic, copy) NSString *taskType;
/**
是否上报分享结果
*/
@property (nonatomic, assign) BOOL isReportShareResult;
/** @brief 显示分享界面*/
- (void)showWithShareUrl:(NSString *)shareUrl;
/** @brief 隐藏分享界面。最后会remove super view*/
- (void)hideShareView;
/**
* @author wangyang, 16-01-22 19:01:00
*
* @brief 调用该方法直接分享到指定平台,但仍会走 fetchSharePublishContent 这个代理方法以取得待分享的内容
* @param type 将要分享到的平台
* @since 5.9.0
*/
- (void)shareWithType:(GMSharePlatform)type;
@property (nonatomic, strong) WMShareObject *shareObject;
@end
This diff is collapsed.
//
// WMShareObject.h
// Gengmei
//
// Created by Sean Lee on 7/22/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import "GMShareBaseObject.h"
//#import <GMBase/GMObject.h>
@protocol WMShareBasicObject @end
@interface WMShareBasicObject : GMShareBaseObject
@property (nonatomic,strong) NSString * title;
@property (nonatomic,strong) NSString * content;
@end
@protocol GMWechatminiObject @end
@interface GMWechatminiObject : GMShareBaseObject
@property (nonatomic,strong) NSString * desc;
@property (nonatomic,strong) NSString * title;
@property (nonatomic,strong) NSString * hdImageUrl;
@property (nonatomic,strong) NSString * path;
@property (nonatomic,strong) NSString * userName;
@property (nonatomic,strong) NSString * thumbImageUrl;
@end
@protocol WMShareObject @end
@interface WMShareObject : GMShareBaseObject
@property (nonatomic,strong) NSString * image;
@property (nonatomic,strong) NSString * url;
@property (nonatomic,strong) NSString * from;
@property (nonatomic,strong) NSString * showPrice;
@property (nonatomic,strong) NSString * organizationName;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* wechat;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* wechatline;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* wechatScreenshot;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* wechatlineScreenshot;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* qq;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* qqzone;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* weibo;
@property (nonatomic,strong) GMWechatminiObject <GMWechatminiObject>* wechatmini;
@property (nonatomic,strong) WMShareBasicObject <WMShareBasicObject>* douyin; // 分享到抖音 扫脸1.5
@property (nonatomic, copy) NSString *page_name;// 埋点使用
@property (nonatomic, copy) NSString *business_id;// 埋点使用
@property (nonatomic, copy) NSString *is_like;//埋点使用
@property (nonatomic, copy) NSString *videoUrl;//视频URL(分享视频时)扫脸1.5
@end
@protocol GMDiaryShareObject @end
@interface GMDiaryShareObject : GMShareBaseObject
@property (nonatomic,strong) NSString *id;
@property (nonatomic,strong) NSString *title;
@property (nonatomic,strong) WMShareObject *shareData;
@end
@protocol GMShareConfigObject @end
@interface GMShareConfigObject : GMShareBaseObject
@property (nonatomic,strong) NSString *hideCopyLink;
@property (nonatomic,strong) NSString *hideRefresh;
@property (nonatomic,strong) NSString *hideReport;
@property (nonatomic,strong) NSString *shareCallback;
@property (nonatomic,strong) NSString *shareTip;
@property (nonatomic,strong) NSString *shareTitle;
@property (nonatomic,strong) NSString *shareInfo;
@property (nonatomic, copy) NSString *taskType;
@property (nonatomic, copy) NSString *isReportShareResult;
@end
//
// WMShareObject.m
// Gengmei
//
// Created by Sean Lee on 7/22/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import "WMShareObject.h"
@implementation WMShareBasicObject
@end
@implementation GMWechatminiObject
@end
@implementation WMShareObject
@end
@implementation GMDiaryShareObject
@end
@implementation GMShareConfigObject
@end
//
// GMShareSDK.h
// Gengmei
//
// Created by licong on 2017/8/16.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "NSMutableDictionary+GMShareSDK.h"
/**
* 分享内容状态变更回调处理器
*
* @param state 状态
* @param userData 附加数据, 返回状态以外的一些数据描述,如:邮件分享取消时,标识是否保存草稿等
* @param error 错误信息,当且仅当state为SSDKResponseStateFail时返回
*/
typedef void(^GMSDKShareStateChangedHandler) (GMShareResponseState state, NSError *error);
@interface GMShareSDK : NSObject
+ (instancetype)shareInstance;
/** 判断微博、微信、QQ是否已经安装*/
+ (BOOL)isClientInstalled:(GMSharePlatform)platformType;
+ (UIImage *)compressWithUrl:(NSString *)url;
+ (UIImage *)compressImage:(UIImage *)image;
+ (NSString *)shareChannel:(GMSharePlatform)platformType;
- (void)share:(GMSharePlatform)platformType
parameters:(NSMutableDictionary *)parameters
onStateChanged:(GMSDKShareStateChangedHandler)stateChangedHandler;
- (void)shareImage:(UIImage *)image platform:(GMSharePlatform)platformType;
@end
//
// GMThirdPartyDefine.h
// Gengmei
//
// Created by licong on 2017/8/2.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#ifndef GMThirdPartyDefine_h
#define GMThirdPartyDefine_h
typedef NS_ENUM(NSInteger, GMShareResponseState) {
GMShareResponseStateBegin = -1,
GMShareResponseStateSuccess = 0,
GMShareResponseStateFail = 1,
GMShareResponseStateCancel = 2,
GMShareResponseStateBack = 3,
};
typedef NS_ENUM(NSInteger, GMSharePlatform) {
GMSharePlatformUnknown = -1,
GMSharePlatformSinaWeibo = 0, /**< 新浪微博 */
GMSharePlatformQQSpace = 1, /**< QQ空间 */
GMSharePlatformQQFriend = 2, /**< QQ好友 */
GMSharePlatformWechatSession = 3, /**< 微信好友 */
GMSharePlatformWechatTimeline = 4, /**< 微信朋友圈 */
GMSharePlatformFav = 5, /**< 收藏 */
GMSharePlatformDelete = 6, /**< 删除 */
GMSharePlatformCopyLink = 7, /**< 复制链接 */
GMSharePlatformRefresh = 8, /**< 刷新 */
GMSharePlatformReport = 9, /**< 举报 */
GMSharePlatformCancelFollow = 10, /**< 圈子取消关注 */
GMSharePlatformWechatSessionSnapShot = 11, /**< 微信好友快照 */
GMSharePlatformWechatTimelineSnapShot = 12, /**< 微信朋友圈快照 */
GMSharePlatformWechatMiniProgram = 13, /**< 微信小程序分享 */
GMSharePlatformPrivateMsg = 14, /**< 更美私信 */
GMSharePlatformInviteAnswer = 15, /** 邀请回复(回复详情和问题详情界面) */
GMSharePlatformWechat = 100, /**< 微信平台*/
GMSharePlatformQQ = 101, /**< QQ平台*/
GMSharePlatformDouyin = 102, /**< 抖音*/
};
/**
* 内容类型
*/
typedef NS_ENUM(NSUInteger, GMShareContentType){
/**
* 自动适配类型,视传入的参数来决定
*/
GMShareContentTypeAuto = 0,
/**
* 文本
*/
GMShareContentTypeText = 1,
/**
* 图片
*/
GMShareContentTypeImage = 2,
/**
* 网页
*/
GMShareContentTypeWebPage = 3,
/**
* 应用
*/
GMShareContentTypeApp = 4,
/**
* 音频
*/
GMShareContentTypeAudio = 5,
/**
* 视频
*/
GMShareContentTypeVideo = 6,
/**
* 文件类型(暂时仅微信可用)
*/
GMShareContentTypeFile = 7,
//图片类型 仅FacebookMessage 分享图片并需要明确结果时 注此类型分享后不会显示应用名称与icon
//v3.6.2 增加
GMShareContentTypeFBMessageImages = 8,
//图片类型 仅FacebookMessage 分享视频并需要明确结果时 注此类型分享后不会显示应用名称与icon
//所分享的视频地址必须为相册地址
//v3.6.2 增加
GMShareContentTypeFBMessageVideo = 9,
//3.6.3 小程序分享(暂时仅微信可用)
GMShareContentTypeMiniProgram = 10
};
#define kQQLogin @"kQQLogin"
#define kSinaLogin @"kSinaLogin"
#define kWechatLogin @"kWechatLogin"
//QQ好友和朋友圈会掉的url完全一样,所以没必要区分 QQ41A1DB6D://response_from_qq?source=qq&source_scheme=mqqapi&error=0&version=1&sdkv=3.1
#define kQQShare @"kQQShare"
#define kSinaShare @"kSinaShare"
#define kWechatShare @"kWechatShare"
#define kDouyinShare @"kDouyinShare"
#define kThirdPartyLoginBack @"kThirdPartyLoginBack"
#define kThirdPartyShareBack @"kThirdPartyShareBack"
#define WEICHAT_BASE_URL @"https://api.weixin.qq.com/sns"
//有关登陆授权的一些key
#ifdef APPSTORE
#define WEIXIN_APPID @"wx4326da3ad2429149" //WeiXin appId
#define WEIXIN_SECRET @"971147c78f55c3a657394a7a31f4266a" //WeiXin secret
#else
#define WEIXIN_APPID @"wx403cd28c142c7d87" //WeiXin appId
#define WEIXIN_SECRET @"035af39ad74bbc01b7517a291c836827" //WeiXin secret
#endif
#define QQ_APPID @"1101126509" //QQ APPID
#define QQ_HEX_APPID @"41A1DB6D" //16进制的QQ appid
#define QQ_APPKEY @"yD4Eu3WZX6egmrMU" //QQ APPKEY
#define SINAWEIBO_APPID @"2387882244" //Sina Weibo APPKEY
#define SINAWEIBO_APPKEY @"8480ee24118f0dec4f71e0ca1ba8638e" //Sina Weibo secret
#define SINAWEIBO_REDIRECTURI @"http://www.wanmeizhensuo.com/api/user/weibo/auth/"
#define DOUYIN_APPID @"awedc2tmuly0pozy" //抖音 APPID
#define DOUYIN_APPKEY @"cd39b2610b33244eef66eab3327e4d72" // douyin secret
#define QM_APPID @"4e26f886" //QM APPID
#endif /* GMThirdPartyDefine_h */
//
// GMThirdPartyLoginHelper.h
// Gengmei
//
// Created by licong on 2017/8/2.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "GMThirdPartyDefine.h"
@interface GMThirdPartyUser : NSObject
@property (nonatomic, copy) NSString * nickname;
@property (nonatomic, copy) NSString * uid;
@property (nonatomic, copy) NSString * unionid;
@property (nonatomic, copy) NSString * icon;
@property (nonatomic, copy) NSString * provice;
@property (nonatomic, copy) NSString * city;
@property (nonatomic, assign) GMSharePlatform platformType;
@property (nonatomic, copy) NSString *thirdDetail;
@end
typedef void (^GMThirdPartyUserHandler) (GMShareResponseState state, GMThirdPartyUser *user);
@interface GMThirdPartyLoginHelper : NSObject
+ (void)loginByPlatform:(GMSharePlatform)platform
onUserSync:(GMThirdPartyUserHandler)userHandler;
+ (void)thirdPartyLogout;
@end
//
// GMThirdPartyLoginHelper.m
// Gengmei
//
// Created by licong on 2017/8/2.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import "GMThirdPartyLoginHelper.h"
#import "WechatOpenSDK/WXApi.h"
#import "WeiboSDK/WeiboSDK.h"
#import "GMThirdPartyDefine.h"
#import "GMThirdPartyOauthManager.h"
#import "TencentOpenAPI/TencentOAuth.h"
@implementation GMThirdPartyUser
@end
@implementation GMThirdPartyLoginHelper
+ (void)loginByPlatform:(GMSharePlatform)platform
onUserSync:(GMThirdPartyUserHandler)userHandler{
[GMThirdPartyOauthManager shareInstance].user.platformType = platform;
if (platform == GMSharePlatformQQ) {
NSArray* permissions = [NSArray arrayWithObjects:@"get_user_info",@"get_simple_userinfo", @"add_t", nil];
[[GMThirdPartyOauthManager shareInstance].tencentOAuth setAuthShareType: AuthShareType_QQ];
[[GMThirdPartyOauthManager shareInstance].tencentOAuth authorize:permissions inSafari:NO];
__block id observer = [[NSNotificationCenter defaultCenter] addObserverForName:kQQLogin object:nil queue: [NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) {
GMShareResponseState state = (GMShareResponseState )[note.userInfo[@"state"] integerValue];
userHandler(state, note.object);
[[NSNotificationCenter defaultCenter] removeObserver:observer];
}];
} else if (platform == GMSharePlatformWechat) {
if ([WXApi isWXAppInstalled]){
[GMThirdPartyLoginHelper wechatLogin];
__block id observer = [[NSNotificationCenter defaultCenter] addObserverForName:kWechatLogin object:nil queue: [NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) {
GMShareResponseState state = (GMShareResponseState )[note.userInfo[@"state"] integerValue];
userHandler(state, note.object);
[[NSNotificationCenter defaultCenter] removeObserver:observer];
}];
}
} else if (platform == GMSharePlatformSinaWeibo){
WBAuthorizeRequest *request = [WBAuthorizeRequest request];
request.redirectURI = SINAWEIBO_REDIRECTURI ;
//http://open.weibo.com/wiki/Scope
request.scope = @"all";
request.userInfo = @{@"flag": @"authorize"};
[WeiboSDK sendRequest:request];
__block id observer = [[NSNotificationCenter defaultCenter] addObserverForName:kSinaLogin object:nil queue: [NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) {
GMShareResponseState state = (GMShareResponseState )[note.userInfo[@"state"] integerValue];
userHandler(state, note.object);
[[NSNotificationCenter defaultCenter] removeObserver:observer];
}];
}
}
+ (void)wechatLogin {
if ([WXApi isWXAppInstalled]){
//构造SendAuthReq结构体
SendAuthReq* req = [[SendAuthReq alloc ] init];
req.scope = @"snsapi_userinfo" ;
req.state = @"Gengmei" ;
//第三方向微信终端发送一个SendAuthReq消息结构
#warning TODOl待验证
[WXApi sendReq:req completion:^(BOOL success) {
}];
}
}
+ (void)thirdPartyLogout {
if ([GMThirdPartyOauthManager shareInstance].user.platformType == GMSharePlatformQQ){
[GMThirdPartyOauthManager shareInstance].tencentOAuth = [[TencentOAuth alloc] initWithAppId:QQ_APPID andDelegate:[GMThirdPartyOauthManager shareInstance]];
}
}
@end
//
// GMThirdPartyOauthManager.h
// Gengmei
//
// Created by licong on 2017/8/2.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "GMThirdPartyLoginHelper.h"
//这里是接受三方授权的回调
@class TencentOAuth;
@interface GMThirdPartyOauthManager : NSObject
@property (nonatomic, strong) GMThirdPartyUser * user;
@property (nonatomic, assign) GMSharePlatform currentShareType;
@property (strong, nonatomic) NSString *wbtoken;
@property (strong, nonatomic) TencentOAuth * tencentOAuth;
+ (instancetype)shareInstance;
@end
//
// NSMutableDictionary+GMShareSDK.h
// Gengmei
//
// Created by licong on 2017/8/18.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "GMThirdPartyDefine.h"
@interface NSMutableDictionary (GMShareSDK)
/**
* 设置分享参数
*
* @param text 文本
* @param images 图片集合,传入参数可以为单张图片信息,也可以为一个NSArray,数组元素可以为UIImage、NSString(图片路径)、NSURL(图片路径)、SSDKImage。如: @"http://www.mob.com/images/logo_black.png" 或 @[@"http://www.mob.com/images/logo_black.png"]
* @param url 网页路径/应用路径
* @param title 标题
* @param type 分享类型
*/
- (void)shareSetupShareParamsByText:(NSString *)text
images:(id)images
url:(NSURL *)url
title:(NSString *)title
type:(GMShareContentType)type;
/**
* 设置分享参数
*
* @param text 文本
* @param images 图片集合,传入参数可以为单张图片信息,也可以为一个NSArray,数组元素可以为UIImage、NSString(图片路径)、NSURL(图片路径)、SSDKImage。如: @"http://www.mob.com/images/logo_black.png" 或 @[@"http://www.mob.com/images/logo_black.png"]
* @param url 网页路径/应用路径
* @param title 标题
* @param type 分享类型
* @param videoUrl 视频的URL
*/
- (void)shareSetupShareParamsByText:(NSString *)text
images:(id)images
url:(NSURL *)url
title:(NSString *)title
videoUrl:(NSURL *)videoUrl
type:(GMShareContentType)type;
/**
* 设置微信小程序分享参数
*
* @param text 网页路径/应用路径
* @user name 小程序的原始id
* @user path 小程序页面的路径
* @param title 小程序标题
* @param description 小程序描述
* @param thumbImage 缩略图
* @param hdImageData 小程序节点高清大图,小于128k
*/
- (void)shareSetupMiniProgramShareParamsByUrl:(NSString *)url
userName:(NSString *)userName
path:(NSString *)path
title:(NSString *)title
description:(NSString *)description
thumbImage:(id)thumbImage
hdImageData:(id)hdImageData;
@end
//
// NSMutableDictionary+GMShareSDK.m
// Gengmei
//
// Created by licong on 2017/8/18.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import "NSMutableDictionary+GMShareSDK.h"
#import <WechatOpenSDK/WXApiObject.h>
@implementation NSMutableDictionary (GMShareSDK)
- (void)shareSetupShareParamsByText:(NSString *)text
images:(id)images
url:(NSURL *)url
title:(NSString *)title
type:(GMShareContentType)type{
self[@"text"] = text;
self[@"images"] = images;
self[@"url"] = url;
self[@"title"] = title;
self[@"type"] = @(type);
}
- (void)shareSetupShareParamsByText:(NSString *)text
images:(id)images
url:(NSURL *)url
title:(NSString *)title
videoUrl:(NSURL *)videoUrl
type:(GMShareContentType)type {
self[@"text"] = text;
self[@"images"] = images;
self[@"url"] = url;
self[@"title"] = title;
self[@"type"] = @(type);
self[@"videoUrl"] = videoUrl;
}
- (void)shareSetupMiniProgramShareParamsByUrl:(NSString *)url
userName:(NSString *)userName
path:(NSString *)path
title:(NSString *)title
description:(NSString *)description
thumbImage:(id)thumbImage
hdImageData:(id)hdImageData{
self[@"url"] = url;
self[@"userName"] = userName;
self[@"path"] = path;
self[@"title"] = title;
self[@"description"] = description;
self[@"thumbImage"] = thumbImage;
self[@"hdImageData"] = hdImageData;
self[@"type"] = @(GMShareContentTypeMiniProgram);
}
@end
//
// NSURLRequest+IgnoreSSL.h
// tencentOAuthDemo
//
// Created by JeaminW on 13-5-20.
//
//
#import <Foundation/Foundation.h>
@interface NSURLRequest (IgnoreSSL)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host;
@end
//
// NSURLRequest+IgnoreSSL.m
// tencentOAuthDemo
//
// Created by JeaminW on 13-5-20.
//
//
#import "NSURLRequest+IgnoreSSL.h"
@implementation NSURLRequest (IgnoreSSL)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host
{
return YES;
}
@end
///
/// \file QQApiInterface.h
/// \brief QQApi接口简化封装
///
/// Created by Tencent on 12-5-15.
/// Copyright (c) 2012年 Tencent. All rights reserved.
///
#import <Foundation/Foundation.h>
#import "QQApiInterfaceObject.h"
typedef void (^sendResultBlock)(NSDictionary *result);
/**
\brief 处理来至QQ的请求及响应的回调协议
*/
@protocol QQApiInterfaceDelegate <NSObject>
/**
处理来至QQ的请求
*/
- (void)onReq:(QQBaseReq *)req;
/**
处理来至QQ的响应
*/
- (void)onResp:(QQBaseResp *)resp;
/**
处理QQ在线状态的回调
*/
- (void)isOnlineResponse:(NSDictionary *)response;
@end
/**
\brief 对QQApi的简单封装类
*/
@interface QQApiInterface : NSObject
/**
处理由手Q唤起的普通跳转请求
\param url 待处理的url跳转请求
\param delegate 第三方应用用于处理来至QQ请求及响应的委托对象
\return 跳转请求处理结果,YES表示成功处理,NO表示不支持的请求协议或处理失败
*/
+ (BOOL)handleOpenURL:(NSURL *)url delegate:(id<QQApiInterfaceDelegate>)delegate;
/**
处理由手Q唤起的universallink跳转请求
\param universallink 待处理的universallink跳转请求
\param delegate 第三方应用用于处理来至QQ请求及响应的委托对象
\return 跳转请求处理结果,YES表示成功处理,NO表示不支持的请求协议或处理失败
*/
+ (BOOL)handleOpenUniversallink:(NSURL*)universallink delegate:(id<QQApiInterfaceDelegate>)delegate;
/**
向手Q发起分享请求
\param req 分享内容的请求
\return 请求发送结果码
*/
+ (QQApiSendResultCode)sendReq:(QQBaseReq *)req;
/**
向手Q QZone结合版发起分享请求
\note H5分享只支持单张网络图片的传递
\param req 分享内容的请求
\return 请求发送结果码
*/
+ (QQApiSendResultCode)SendReqToQZone:(QQBaseReq *)req;
/**
向手Q发起设置QQ头像
\param req 分享内容的请求
\return 请求发送结果码
*/
+ (QQApiSendResultCode)sendMessageToQQAvatarWithReq:(QQBaseReq*)req;
/**
向手Q发起组图分享到表情收藏
\param req 分享内容的请求
\return 请求发送结果码
*/
+ (QQApiSendResultCode)sendMessageToFaceCollectionWithReq:(QQBaseReq*)req;
/**
检测是否已安装QQ
\return 如果QQ已安装则返回YES,否则返回NO
\note SDK目前已经支持QQ、TIM授权登录及分享功能, 会按照QQ>TIM的顺序进行调用。
只要用户安装了QQ、TIM中任意一个应用,都可为第三方应用进行授权登录、分享功能。
第三方应用在接入SDK时不需要判断是否安装QQ、TIM。若有判断安装QQ、TIM的逻辑建议移除。
*/
+ (BOOL)isQQInstalled;
/**
检测是否已安装TIM
\return 如果TIM已安装则返回YES,否则返回NO
\note SDK目前已经支持QQ、TIM授权登录及分享功能, 会按照QQ>TIM的顺序进行调用。
只要用户安装了QQ、TIM中任意一个应用,都可为第三方应用进行授权登录、分享功能。
第三方应用在接入SDK时不需要判断是否安装QQ、TIM。若有判断安装QQ、TIM的逻辑建议移除。
*/
+ (BOOL)isTIMInstalled;
/**
检测QQ是否支持API调用
\return 如果当前安装QQ版本支持API调用则返回YES,否则返回NO
*/
+ (BOOL)isQQSupportApi;
/**
检测TIM是否支持API调用
\return 如果当前安装TIM版本支持API调用则返回YES,否则返回NO
*/
+ (BOOL)isTIMSupportApi __attribute__((deprecated("已过期, 建议删除调用,调用地方用YES替代。")));
/**
检测是否支持分享
\return 如果当前已安装QQ且QQ版本支持API调用 或者 当前已安装TIM且TIM版本支持API调用则返回YES,否则返回NO
*/
+ (BOOL)isSupportShareToQQ;
/**
检测是否支持分享到QQ结合版QZone
\return 如果当前已安装QQ且QQ版本支持API调用则返回YES,否则返回NO
*/
+ (BOOL)isSupportPushToQZone;
/**
启动QQ
\return 成功返回YES,否则返回NO
*/
+ (BOOL)openQQ;
/**
启动TIM
\return 成功返回YES,否则返回NO
*/
+ (BOOL)openTIM;
/**
获取QQ下载地址
如果App通过<code>QQApiInterface#isQQInstalled</code>和<code>QQApiInterface#isQQSupportApi</code>检测发现QQ没安装或当前版本QQ不支持API调用,可引导用户通过打开此链接下载最新版QQ。
\return iPhoneQQ下载地址
*/
+ (NSString *)getQQInstallUrl;
/**
获取TIM下载地址
如果App通过<code>QQApiInterface#isTIMInstalled</code>检测发现TIM没安装或当前版本TIM不支持API调用,可引导用户通过打开此链接下载最新版TIM。
\return iPhoneTIM下载地址
*/
+ (NSString *)getTIMInstallUrl;
@end
Copyright (c) 2019 Q14 <qiaojinzhu@igengmei.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# GMShareSDK
[![CI Status](https://img.shields.io/travis/Q14/GMShareSDK.svg?style=flat)](https://travis-ci.org/Q14/GMShareSDK)
[![Version](https://img.shields.io/cocoapods/v/GMShareSDK.svg?style=flat)](https://cocoapods.org/pods/GMShareSDK)
[![License](https://img.shields.io/cocoapods/l/GMShareSDK.svg?style=flat)](https://cocoapods.org/pods/GMShareSDK)
[![Platform](https://img.shields.io/cocoapods/p/GMShareSDK.svg?style=flat)](https://cocoapods.org/pods/GMShareSDK)
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
GMShareSDK is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'GMShareSDK'
```
## Author
Q14, qiaojinzhu@igengmei.com
## License
GMShareSDK is available under the MIT license. See the LICENSE file for more info.
//
// AsyncUtil.swift
// Pods
//
// Created by Thierry on 16/6/14.
//
//
import Foundation
/**
Postpone execute [task].
- parameter delay: time to delay
- parameter closure: the code to postpone execute.
*/
public func delay(_ delay: Double, closure:@escaping ()->()) {
DispatchQueue.main.asyncAfter(
deadline: DispatchTime.now() + Double(Int64(delay * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC), execute: closure)
}
/**
Execute [task] asynchronously.
- parameter task: the code to execute asynchronously.
*/
public func doAsync(_ task: @escaping ()->()) {
DispatchQueue.global().async(execute: task)
}
/**
Execute [task] on the application UI thread.
- parameter task: task the code to execute UI thread.
*/
public func uiThread(_ task: @escaping ()->()) {
DispatchQueue.main.async(execute: task)
}
//
// LogUtil.swift
// Achilles
//
// Created by Thierry on 16/1/8.
// Copyright © 2016年 Thierry. All rights reserved.
//
import Foundation
/**
Show fill log information in debug enviroment.
- parameter message: log message
- parameter file: log in which file
- parameter method: log in which method
- parameter line: log in which line
*/
public func debugLog<T>(_ message: T,
file: String = #file,
method: String = #function,
line: Int = #line) {
#if DEBUG
print("\((file as Foundation.NSString).lastPathComponent)[\(line)], \(method):\n \(message)\n")
#endif
}
Copyright (c) 2016 Thierry <thierry.xing@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# GMUtil
[![CI Status](http://img.shields.io/travis/Thierry/GMUtil.svg?style=flat)](https://travis-ci.org/Thierry/GMUtil)
[![Version](https://img.shields.io/cocoapods/v/GMUtil.svg?style=flat)](http://cocoapods.org/pods/GMUtil)
[![License](https://img.shields.io/cocoapods/l/GMUtil.svg?style=flat)](http://cocoapods.org/pods/GMUtil)
[![Platform](https://img.shields.io/cocoapods/p/GMUtil.svg?style=flat)](http://cocoapods.org/pods/GMUtil)
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
GMUtil is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "GMUtil"
```
## Author
Thierry, thierry.xing@gmail.com
## License
GMUtil is available under the MIT license. See the LICENSE file for more info.
../../../DouyinOpenSDK/DouyinOpenSDK/Headers/DouyinOpenSDKApi.h
\ No newline at end of file
../../../DouyinOpenSDK/DouyinOpenSDK/Headers/DouyinOpenSDKApiObject.h
\ No newline at end of file
../../../WechatOpenSDK/WeChatSDK1.8.6.1/WXApi.h
\ No newline at end of file
../../../WechatOpenSDK/WeChatSDK1.8.6.1/WXApiObject.h
\ No newline at end of file
../../../WechatOpenSDK/WeChatSDK1.8.6.1/WechatAuthSDK.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBHttpRequest+WeiboGame.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBHttpRequest+WeiboShare.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBHttpRequest+WeiboToken.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBHttpRequest+WeiboUser.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBHttpRequest.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBSDKBasicButton.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBSDKCommentButton.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBSDKRelationshipButton.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WeiboSDK.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WeiboUser.h
\ No newline at end of file
../../../DouyinOpenSDK/DouyinOpenSDK/Headers/DouyinOpenSDKApi.h
\ No newline at end of file
../../../DouyinOpenSDK/DouyinOpenSDK/Headers/DouyinOpenSDKApiObject.h
\ No newline at end of file
../../../WechatOpenSDK/WeChatSDK1.8.6.1/WXApi.h
\ No newline at end of file
../../../WechatOpenSDK/WeChatSDK1.8.6.1/WXApiObject.h
\ No newline at end of file
../../../WechatOpenSDK/WeChatSDK1.8.6.1/WechatAuthSDK.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBHttpRequest+WeiboGame.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBHttpRequest+WeiboShare.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBHttpRequest+WeiboToken.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBHttpRequest+WeiboUser.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBHttpRequest.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBSDKBasicButton.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBSDKCommentButton.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WBSDKRelationshipButton.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WeiboSDK.h
\ No newline at end of file
../../../WeiboSDK/libWeiboSDK/WeiboUser.h
\ No newline at end of file
This diff is collapsed.
The MIT License (MIT)
Copyright (c) 2014 Hearst
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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