Skip to content

Commit

Permalink
# 6.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
garenwang committed Mar 18, 2024
1 parent 9662220 commit 009e32f
Show file tree
Hide file tree
Showing 59 changed files with 2,159 additions and 265 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 6.3.7


# 6.3.6

优化track上报

# 6.3.5

Expand Down
8 changes: 4 additions & 4 deletions QCloudCOSXML.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |s|
s.name = "QCloudCOSXML"


s.version = "6.3.6"
s.version = "6.3.7"


s.summary = "QCloudCOSXML 腾讯云iOS-SDK组件"
Expand All @@ -20,15 +20,15 @@ s.version = "6.3.6"
s.default_subspec = 'Default'
s.subspec 'Default' do |default|
default.source_files = 'QCloudCOSXML/Classes/**/*','QCloudCOSXML/Classes/QCloudCOSXML/*'
default.dependency "QCloudCore",'6.3.6'
default.dependency "QCloudCore",'6.3.7'
end
s.subspec 'Slim' do |slim|
slim.source_files = 'QCloudCOSXML/Classes/**/*','QCloudCOSXML/Classes/QCloudCOSXML/*'
slim.dependency "QCloudCore/WithoutMTA",'6.3.6'
slim.dependency "QCloudCore/WithoutMTA",'6.3.7'
end
s.subspec 'Transfer' do |transfer|
transfer.source_files = 'QCloudCOSXML/Classes/*','QCloudCOSXML/Classes/Transfer/**/*','QCloudCOSXML/Classes/Base/**/*'
transfer.dependency "QCloudCore/WithoutMTA",'6.3.6'
transfer.dependency "QCloudCore/WithoutMTA",'6.3.7'

end

Expand Down
4 changes: 3 additions & 1 deletion QCloudCOSXML/Classes/Base/QCloudCOSXMLService+Quality.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ + (QCloudCOSXMLService *)Quality_registerDefaultCOSXMLWithConfiguration:(QCloudS
}

+ (void)initMTA:(QCloudServiceConfiguration *)configuration {

#if defined(DEBUG) && DEBUG
#else
[QualityDataUploader startWithAppkey:kQCloudDataAppReleaseKey];
NSMutableDictionary * commonParams = [self commonParams:nil];
commonParams[@"sdk_bridge"] = configuration.bridge?:@"";
[QualityDataUploader initCommonParams:commonParams];
[QualityDataUploader trackBaseInfoToTrachCommonParams:commonParams];
[QualityDataUploader startWithAppkey:kQCloudDataAppReleaseKey];
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion QCloudCOSXML/Classes/CI/model/QCloudPicOperations.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ - (NSString *)getPicOperationsJson {
}

NSDictionary *dicOperations = @{ @"is_pic_info" : _is_pic_info ? @(1) : @(0), @"rules" : [self getRules] };
QCloudLogInfo(@"水印生成成功————%@", [dicOperations qcloud_modelToJSONString]);
QCloudLogInfo(@"%@", [dicOperations qcloud_modelToJSONString]);
return [dicOperations qcloud_modelToJSONString];
}

Expand Down
2 changes: 1 addition & 1 deletion QCloudCOSXML/Classes/QCloudCOSXMLVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#ifndef QCloudCOSXMLModuleVersion_h
#define QCloudCOSXMLModuleVersion_h
#define QCloudCOSXMLModuleVersionNumber 603006
#define QCloudCOSXMLModuleVersionNumber 603007

//dependency

Expand Down
2 changes: 1 addition & 1 deletion QCloudCOSXML/Classes/QCloudCOSXMLVersion.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import "QCloudCOSXMLVersion.h"
NSString * const QCloudCOSXMLModuleVersion = @"6.3.6";
NSString * const QCloudCOSXMLModuleVersion = @"6.3.7";
NSString * const QCloudCOSXMLModuleName = @"QCloudCOSXML";
@interface QCloudQCloudCOSXMLLoad : NSObject
@end
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion QCloudCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.name = "QCloudCore"


s.version = "6.3.6"
s.version = "6.3.7"



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ - (void)executeRestHTTPReqeust:(QCloudHTTPRequest *)httpRequest {
return;
}
NSMutableURLRequest *transformRequest = urlRequest;
if (httpRequest.requestSerializer.HTTPDNSPrefetch) {
if (httpRequest.requestSerializer.HTTPDNSPrefetch && !httpRequest.runOnService.configuration.disableGlobalHTTPDNSPrefetch) {
transformRequest = [[QCloudHttpDNS shareDNS] resolveURLRequestIfCan:urlRequest];
if (error) {
QCloudLogError(@"DNS转存请求失败%@", error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ NS_ASSUME_NONNULL_BEGIN

/// 是否禁止上传空文件 NO 不禁止。YES 禁止
@property (nonatomic, assign) BOOL disableUploadZeroData;


/// 是否全局禁用HTTPDNSPrefetch功能获取到IP。
@property (nonatomic, assign) BOOL disableGlobalHTTPDNSPrefetch;
@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ - (instancetype)init {
if (!self) {
return self;
}
_useHTTPS = NO;
_useHTTPS = YES;
return self;
}
- (instancetype)initWithLiteralURL:(NSURL *)url {
Expand Down
2 changes: 1 addition & 1 deletion QCloudCore/Classes/Base/QCloudCoreVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#ifndef QCloudCoreModuleVersion_h
#define QCloudCoreModuleVersion_h
#define QCloudCoreModuleVersionNumber 603006
#define QCloudCoreModuleVersionNumber 603007

//dependency

Expand Down
2 changes: 1 addition & 1 deletion QCloudCore/Classes/Base/QCloudCoreVersion.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import "QCloudCoreVersion.h"
NSString * const QCloudCoreModuleVersion = @"6.3.6";
NSString * const QCloudCoreModuleVersion = @"6.3.7";
NSString * const QCloudCoreModuleName = @"QCloudCore";
@interface QCloudQCloudCoreLoad : NSObject
@end
Expand Down
17 changes: 17 additions & 0 deletions QCloudCore/Classes/Base/QualityAssurance/QualityDataUploader.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,27 @@ extern NSString *const kQCloudQualityErrorIDKey;
extern NSString *const kQCloudRequestAppkeyKey;

@interface QualityDataUploader : NSObject

/// 初始化公共参数
+(void)initCommonParams:(NSMutableDictionary * )commonParams;

/// 设置sdk 上报灯塔 appkey
/// - Parameter appkey: 灯塔appkey
+ (void)startWithAppkey:(NSString *)appkey;


/// SDK 内部使用,上报请求成功信息
+ (void)trackSDKRequestSuccessWithRequest:(QCloudAbstractRequest *)request params:(NSMutableDictionary * )commonParams;

/// SDK 内部使用,上报请求失败信息
+ (void)trackSDKRequestFailWithRequest:(QCloudAbstractRequest *)request error:(NSError *)error params:(NSMutableDictionary * )commonParams;

/// 使用 SDK 内默认 TrackService 上报数据
+ (void)trackNormalEventWithKey:(NSString *)key props:(NSDictionary *)props;

/// 指定 TrackService 上报数据
+ (void)trackNormalEventWithKey:(NSString *)key serviceKey:(NSString *)serviceKey props:(NSDictionary *)props;

/// SDK 内使用 上报基础数据
+ (void)trackBaseInfoToTrachCommonParams:(NSMutableDictionary * )commonParams;
@end
51 changes: 19 additions & 32 deletions QCloudCore/Classes/Base/QualityAssurance/QualityDataUploader.m
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ + (void)startWithAppkey:(NSString *)appkey {
id report = [cls performSelector:NSSelectorFromString(@"singleService")];
id beaconService = [beaconCls performSelector:NSSelectorFromString(@"new")];
[beaconService performSelector:NSSelectorFromString(@"updateBeaconKey:") withObject:appkey];
[report performSelector:NSSelectorFromString(@"addTrackService:serviceKey:") withObject:beaconService withObject:[self qcloud_trackServiceKey]];
[report performSelector:NSSelectorFromString(@"addTrackService:serviceKey:") withObject:beaconService withObject:[self qcloud_trackSDKEventKey]];

);

Expand Down Expand Up @@ -221,12 +221,16 @@ + (void)trackBaseInfoToTrachCommonParams:(NSMutableDictionary * )commonParams{
}

+ (void)trackNormalEventWithKey:(NSString *)key props:(NSDictionary *)props {
[self trackNormalEventWithKey:key serviceKey:nil props:props];
}

+ (void)trackNormalEventWithKey:(NSString *)key serviceKey:(NSString *)serviceKey props:(NSDictionary *)props {

NSString * appKey = props[kQCloudRequestAppkeyKey];
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithDictionary:props];
[params removeObjectForKey:kQCloudRequestAppkeyKey];

[self startReportWithEventKey:key paramters:params];
[self startReportWithEventKey:key serviceKey:serviceKey paramters:params];
}

//上报成功的事件:需要排除掉uploadPart、uploadPartCopy等请求,在其对应的高级接口成功的回调中上报
Expand All @@ -239,26 +243,14 @@ + (void)trackSDKRequestSuccessWithRequest:(QCloudAbstractRequest *)request param
NSMutableDictionary *paramas = commonParams?:[NSMutableDictionary dictionary];
paramas[kQCloudQualityResultKey] = kQCloudRequestSuccessKey;
paramas[kQCloudQualityErrorRequestNameKey] = [self getServiceNameFromClass:request.class];
[self internalUploadRequest:request event:[self qcloud_trackServiceKey] withParamter:paramas];
[self internalUploadRequest:request event:[self qcloud_trackSDKEventKey] withParamter:paramas];
}

+(void)initCommonParams:(NSMutableDictionary * )commonParams{
productName = commonParams[@"pName"];
if (productName) {
[commonParams removeObjectForKey:@"pName"];
}
sdkVersion = commonParams[@"sdkVersion"];
if (sdkVersion) {
[commonParams removeObjectForKey:@"sdkVersion"];
}
sdkVersionName = commonParams[@"sdkVersionName"];
if (sdkVersionName != nil) {
[commonParams removeObjectForKey:@"sdkVersionName"];
}
appKey = commonParams[kQCloudRequestAppkeyKey];
if (appKey) {
[commonParams removeObjectForKey:kQCloudRequestAppkeyKey];
}
}

+(NSDictionary *)getRequestURLInfo:(QCloudAbstractRequest *)request{
Expand Down Expand Up @@ -289,7 +281,10 @@ +(NSDictionary *)getRequestURLInfo:(QCloudAbstractRequest *)request{
urlInfo[@"http_retry_times"] = @(bizRequest.retryCount).stringValue;
urlInfo[@"http_dns_ips"] = [[[QCloudHttpDNS shareDNS] queryIPsForHost:bizRequest.urlRequest.URL.host] componentsJoinedByString:@","];
}
urlInfo[@"sdk_bridge"] = sdkBridge;
if (sdkBridge) {
urlInfo[@"sdk_bridge"] = sdkBridge;
}

return urlInfo.copy;
}
//上报失败的事件,需要上报网络性能,错误码
Expand All @@ -299,8 +294,7 @@ + (void)trackSDKRequestFailWithRequest:(QCloudAbstractRequest *)request error:(N
return;

[self initCommonParams:commonParams];

Class cls = [request class];

NSMutableDictionary *mutableDicParams = [[error toUploadEventParamters] mutableCopy];

[mutableDicParams addEntriesFromDictionary:commonParams];
Expand Down Expand Up @@ -328,7 +322,7 @@ + (void)trackSDKRequestFailWithRequest:(QCloudAbstractRequest *)request error:(N
}
mutableDicParams[kQCloudQualityErrorRequestNameKey] = [self getServiceNameFromClass:request.class];
mutableDicParams[kQCloudQualityResultKey] = kQCloudRequestFailureKey;
[self internalUploadRequest:request event:[self qcloud_trackServiceKey] withParamter:mutableDicParams];
[self internalUploadRequest:request event:[self qcloud_trackSDKEventKey] withParamter:mutableDicParams];
}


Expand Down Expand Up @@ -395,11 +389,11 @@ + (void)startReportSDKWithEventKey:(NSString *)eventKey paramters:(NSMutableDict
#if defined(DEBUG) && DEBUG

#else
[self startReportWithEventKey:eventKey paramters:[paramter copy]];
[self startReportWithEventKey:eventKey serviceKey:nil paramters:[paramter copy]];
#endif
}

+ (void)startReportWithEventKey:(NSString *)eventKey paramters:(NSDictionary *)paramter {
+ (void)startReportWithEventKey:(NSString *)eventKey serviceKey:(NSString *)serviceKey paramters:(NSDictionary *)paramter {


Class cls = NSClassFromString(@"QCloudTrackService");
Expand All @@ -408,7 +402,9 @@ + (void)startReportWithEventKey:(NSString *)eventKey paramters:(NSDictionary *)p
SEL selector = NSSelectorFromString(@"reportWithEventCode:params:serviceKey:");

if ([instance respondsToSelector:selector]) {
NSString * serviceKey = [self qcloud_trackServiceKey];
if (!serviceKey) {
serviceKey = [self qcloud_trackSDKEventKey];
}
NSMethodSignature *methodSignature = [instance methodSignatureForSelector:selector];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:methodSignature];
[invocation setSelector:selector];
Expand Down Expand Up @@ -463,17 +459,8 @@ + (id)invokeClassMethod:(id)obj sel:(SEL)selector withObjects:(NSArray *)objects


//获取上报的EventKey
+ (NSString *)qcloud_trackServiceKey{
+ (NSString *)qcloud_trackSDKEventKey{
return [NSString stringWithFormat:@"qcloud_track_%@_sdk",productName.lowercaseString];
// NSString *classString = NSStringFromClass(cls);
// if ([kUploadEvents containsObject:classString] || [classString isEqualToString:[NSString stringWithFormat:@"QCloudCOS%@UploadObjectRequest",[productName uppercaseString]]]) {
// return [productName?:@"" stringByAppendingString:kQCloudUploadEventCode];
// } else if ([kCopyEvents containsObject:classString] || [classString isEqualToString:@"QCloudCOSXMLCopyObjectRequest"]) {
// return kQCloudCopyEventCode;
// } else if ([kDownloadEvents containsObject:classString]) {
// return [productName?:@"" stringByAppendingString:kQCloudDownloadEventCode];
// }
// return kQCloudBaseEventCode;
}

+ (BOOL)isErrorInsterested:(NSError *)error {
Expand Down
2 changes: 1 addition & 1 deletion QCloudQuic.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.name = "QCloudQuic"


s.version = "6.3.6"
s.version = "6.3.7"


s.summary = "QCloudQuic 腾讯云iOS-SDK组件"
Expand Down
2 changes: 1 addition & 1 deletion QCloudQuic/Classes/QCloudQuicVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#ifndef QCloudQuicModuleVersion_h
#define QCloudQuicModuleVersion_h
#define QCloudQuicModuleVersionNumber 603006
#define QCloudQuicModuleVersionNumber 603007

//dependency

Expand Down
2 changes: 1 addition & 1 deletion QCloudQuic/Classes/QCloudQuicVersion.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import "QCloudQuicVersion.h"
NSString * const QCloudQuicModuleVersion = @"6.3.6";
NSString * const QCloudQuicModuleVersion = @"6.3.7";
NSString * const QCloudQuicModuleName = @"QCloudQuic";
@interface QCloudQCloudQuicLoad : NSObject
@end
Expand Down
33 changes: 27 additions & 6 deletions QCloudTrack/Classes/Beacon/QCloudBeaconTrackService.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#import "QCloudBeaconTrackService.h"
#import "QCloudTrackConstants.h"
#import <BeaconAPI_Base/BeaconReport.h>
#import <COSBeaconAPI_Base/COSBeaconReport.h>
#import "QCloudTrackConstants.h"

void QCloudTrackEnsurePathExist(NSString *path) {
Expand All @@ -19,6 +19,8 @@ void QCloudTrackEnsurePathExist(NSString *path) {
}
}

static BOOL isStartedBeacon;

@interface QCloudBeaconTrackService ()

@property (nonatomic, strong) NSString * beaconKey;
Expand All @@ -33,7 +35,17 @@ - (instancetype)initWithBeaconKey:(NSString *)key
if (self) {
self.beaconKey = key;
if (self.beaconKey) {
[[BeaconReport sharedInstance] startWithAppkey:self.beaconKey config:nil];
@try {
@synchronized ([QCloudBeaconTrackService class]) {
if (!isStartedBeacon) {
[[COSBeaconReport sharedInstance] startWithAppkey:self.beaconKey config:nil];
isStartedBeacon = YES;
}
}
} @catch (NSException *exception) {
NSLog(@"%@",exception);
}

}
}
return self;
Expand All @@ -42,7 +54,16 @@ - (instancetype)initWithBeaconKey:(NSString *)key
- (void)updateBeaconKey:(NSString *)key{
self.beaconKey = key;
if(self.beaconKey){
[[BeaconReport sharedInstance] startWithAppkey:self.beaconKey config:nil];
@try {
@synchronized ([QCloudBeaconTrackService class]) {
if (!isStartedBeacon) {
[[COSBeaconReport sharedInstance] startWithAppkey:self.beaconKey config:nil];
isStartedBeacon = YES;
}
}
} @catch (NSException *exception) {
NSLog(@"%@",exception);
}
}
}

Expand Down Expand Up @@ -106,15 +127,15 @@ -(void)_reportWithEventCode:(NSString *)eventCode params:(NSDictionary *)params{
return;
}

BeaconEvent * eventObj = [BeaconEvent new];
COSBeaconEvent * eventObj = [COSBeaconEvent new];
[eventObj setCode:eventCode];
[eventObj setParams:params?:@{}];
if (self.beaconKey) {
[eventObj setAppKey:self.beaconKey];
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
BeaconReport * beaconInstance = [BeaconReport sharedInstance];
BeaconReportResult * result = [beaconInstance reportEvent:eventObj];
COSBeaconReport * beaconInstance = [COSBeaconReport sharedInstance];
COSBeaconReportResult * result = [beaconInstance reportEvent:eventObj];
});
}

Expand Down
Loading

0 comments on commit 009e32f

Please sign in to comment.