Skip to content

Commit

Permalink
Release 4.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
王洋洋 committed Dec 8, 2022
1 parent 13d0c06 commit ea4b3b7
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 10 deletions.
2 changes: 1 addition & 1 deletion SensorsAnalyticsSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SensorsAnalyticsSDK"
s.version = "4.5.0"
s.version = "4.5.1"
s.summary = "The official iOS SDK of Sensors Analytics."
s.homepage = "http://www.sensorsdata.cn"
s.source = { :git => 'https://github.com/sensorsdata/sa-sdk-ios.git', :tag => "v#{s.version}" }
Expand Down
10 changes: 10 additions & 0 deletions SensorsAnalyticsSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@
F286963328A34FFC00276F78 /* SAExposureManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F286963128A34FFC00276F78 /* SAExposureManager.m */; };
F28997D7273B6D66005E7D5E /* SAGesturePlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = F28997D5273B6D66005E7D5E /* SAGesturePlugin.h */; };
F28997D8273B6D66005E7D5E /* SAGesturePlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = F28997D6273B6D66005E7D5E /* SAGesturePlugin.m */; };
F296FF042935A3DF00C40C48 /* NSObject+SAToString.h in Headers */ = {isa = PBXBuildFile; fileRef = F296FF022935A3DF00C40C48 /* NSObject+SAToString.h */; };
F296FF052935A3DF00C40C48 /* NSObject+SAToString.m in Sources */ = {isa = PBXBuildFile; fileRef = F296FF032935A3DF00C40C48 /* NSObject+SAToString.m */; };
F2B643F62832302F00544BD2 /* SensorsAnalyticsSDK+SAAppExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = F2B643F42832302F00544BD2 /* SensorsAnalyticsSDK+SAAppExtension.h */; settings = {ATTRIBUTES = (Public, ); }; };
F2B643F72832302F00544BD2 /* SensorsAnalyticsSDK+SAAppExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = F2B643F52832302F00544BD2 /* SensorsAnalyticsSDK+SAAppExtension.m */; };
F2C877B828A65849002BDA2C /* SAExposureData+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = F2C877B628A65849002BDA2C /* SAExposureData+Private.h */; };
Expand Down Expand Up @@ -1059,6 +1061,8 @@
F286963128A34FFC00276F78 /* SAExposureManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SAExposureManager.m; sourceTree = "<group>"; };
F28997D5273B6D66005E7D5E /* SAGesturePlugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SAGesturePlugin.h; sourceTree = "<group>"; };
F28997D6273B6D66005E7D5E /* SAGesturePlugin.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SAGesturePlugin.m; sourceTree = "<group>"; };
F296FF022935A3DF00C40C48 /* NSObject+SAToString.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject+SAToString.h"; sourceTree = "<group>"; };
F296FF032935A3DF00C40C48 /* NSObject+SAToString.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSObject+SAToString.m"; sourceTree = "<group>"; };
F2B643F42832302F00544BD2 /* SensorsAnalyticsSDK+SAAppExtension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SensorsAnalyticsSDK+SAAppExtension.h"; sourceTree = "<group>"; };
F2B643F52832302F00544BD2 /* SensorsAnalyticsSDK+SAAppExtension.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "SensorsAnalyticsSDK+SAAppExtension.m"; sourceTree = "<group>"; };
F2C877B628A65849002BDA2C /* SAExposureData+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SAExposureData+Private.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1579,6 +1583,8 @@
45BD80CD26F0B49700DCC759 /* SAThreadSafeDictionary.m */,
F21C226528F7B0E500847823 /* NSDictionary+SACopyProperties.h */,
F21C226628F7B0E500847823 /* NSDictionary+SACopyProperties.m */,
F296FF022935A3DF00C40C48 /* NSObject+SAToString.h */,
F296FF032935A3DF00C40C48 /* NSObject+SAToString.m */,
);
path = Utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -2481,6 +2487,7 @@
F26FDDD8270312C400E1DF32 /* SAConfigOptions+AppPush.h in Headers */,
A82E8951267D918100475757 /* SAEncryptProtocol.h in Headers */,
45A56560263C174300C9C41B /* SAIDFAHelper.h in Headers */,
F296FF042935A3DF00C40C48 /* NSObject+SAToString.h in Headers */,
A82E8953267D918100475757 /* SAECCEncryptor.h in Headers */,
4D958B1A2823D99E0086A71C /* SAFirstDayPropertyPlugin.h in Headers */,
A8356DDB2656459A00FD64AA /* UIViewController+SAAutoTrack.h in Headers */,
Expand Down Expand Up @@ -2801,6 +2808,7 @@
4D2D53BB2591EB3A00805141 /* SAWeakPropertyContainer.m in Sources */,
8876235326E739300067F0B4 /* SAPresetPropertyPlugin.m in Sources */,
F200096228BE10B5003C5113 /* UIViewController+SAInternalProperties.m in Sources */,
F296FF052935A3DF00C40C48 /* NSObject+SAToString.m in Sources */,
F211742226E9A72C00D65E19 /* SAApplication.m in Sources */,
88ED6BD127BE2ECB00888FBC /* SAFlowManager.m in Sources */,
A8356DD72656459A00FD64AA /* SAAppClickTracker.m in Sources */,
Expand Down Expand Up @@ -3078,6 +3086,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -3111,6 +3120,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#import "SADateFormatter.h"
#import "SensorsAnalyticsSDK+Private.h"
#import "SALog.h"
#import "NSObject+SAToString.h"

@implementation NSString (SAProperty)

Expand Down Expand Up @@ -65,11 +66,11 @@ @implementation NSSet (SAProperty)
- (id)sensorsdata_propertyValueWithKey:(NSString *)key error:(NSError *__autoreleasing _Nullable *)error {
NSMutableSet *result = [NSMutableSet set];
for (id element in self) {
if (![element isKindOfClass:NSString.class]) {
*error = SAPropertyError(10002, @"%@ value of NSSet, NSArray must be NSString. got: %@ %@", self, [element class], element);
return nil;
if (![element conformsToProtocol:@protocol(SAPropertyValueProtocol)]) {
continue;
}
id sensorsValue = [(id <SAPropertyValueProtocol>)element sensorsdata_propertyValueWithKey:key error:error];
sensorsValue = [sensorsValue sensorsdata_toString];
if (sensorsValue) {
[result addObject:sensorsValue];
}
Expand All @@ -84,11 +85,11 @@ @implementation NSArray (SAProperty)
- (id)sensorsdata_propertyValueWithKey:(NSString *)key error:(NSError *__autoreleasing _Nullable *)error {
NSMutableArray *result = [NSMutableArray array];
for (id element in self) {
if (![element isKindOfClass:NSString.class]) {
*error = SAPropertyError(10003, @"%@ value of NSSet, NSArray must be NSString. got: %@ %@", self, [element class], element);
return nil;
if (![element conformsToProtocol:@protocol(SAPropertyValueProtocol)]) {
continue;
}
id sensorsValue = [(id <SAPropertyValueProtocol>)element sensorsdata_propertyValueWithKey:key error:error];
sensorsValue = [sensorsValue sensorsdata_toString];
if (sensorsValue) {
[result addObject:sensorsValue];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) Class delegateProxy;

/// 当前代理对象已 hook 的方法集合
@property (nonatomic, copy) NSMutableSet *selectors;
@property (nonatomic, strong) NSMutableSet *selectors;

- (instancetype)initWithDelegate:(id)delegate proxy:(id)proxy;

Expand Down
2 changes: 1 addition & 1 deletion SensorsAnalyticsSDK/Core/SALimitKeyManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

@interface SALimitKeyManager ()

@property (nonatomic, copy) NSMutableDictionary<NSString *, id> *keys;
@property (nonatomic, strong) NSMutableDictionary<NSString *, id> *keys;

@end

Expand Down
2 changes: 1 addition & 1 deletion SensorsAnalyticsSDK/Core/SensorsAnalyticsSDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#import "SALimitKeyManager.h"
#import "NSDictionary+SACopyProperties.h"

#define VERSION @"4.5.0"
#define VERSION @"4.5.1"

void *SensorsAnalyticsQueueTag = &SensorsAnalyticsQueueTag;

Expand Down
31 changes: 31 additions & 0 deletions SensorsAnalyticsSDK/Core/Utils/NSObject+SAToString.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// NSObject+SAToString.h
// SensorsAnalyticsSDK
//
// Created by 陈玉国 on 2022/11/29.
// Copyright © 2015-2022 Sensors Data Co., Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSObject (SAToString)

- (NSString *)sensorsdata_toString;

@end

NS_ASSUME_NONNULL_END
41 changes: 41 additions & 0 deletions SensorsAnalyticsSDK/Core/Utils/NSObject+SAToString.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// NSObject+SAToString.m
// SensorsAnalyticsSDK
//
// Created by 陈玉国 on 2022/11/29.
// Copyright © 2015-2022 Sensors Data Co., Ltd. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#if ! __has_feature(objc_arc)
#error This file must be compiled with ARC. Either turn on ARC for the project or use -fobjc-arc flag on this file.
#endif

#import "NSObject+SAToString.h"
#import "SADateFormatter.h"

@implementation NSObject (SAToString)

- (NSString *)sensorsdata_toString {
if ([self isKindOfClass:[NSString class]]) {
return (NSString *)self;
}
if ([self isKindOfClass:[NSDate class]]) {
NSDateFormatter *dateFormatter = [SADateFormatter dateFormatterFromString:kSAEventDateFormatter];
return [dateFormatter stringFromDate:(NSDate *)self];
}
return self.description;
}

@end

0 comments on commit ea4b3b7

Please sign in to comment.