Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Update to 3.8.0 beta.1 #2

Merged
merged 15 commits into from
Mar 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Analytics.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Analytics"
s.version = "3.7.0-beta.4"
s.version = "3.8.0-beta.1"
s.summary = "The hassle-free way to add analytics to your iOS app."

s.description = <<-DESC
Expand All @@ -17,7 +17,8 @@ Pod::Spec.new do |s|
s.ios.deployment_target = '7.0'
s.tvos.deployment_target = '9.0'

s.frameworks = 'CoreTelephony', 'Security', 'StoreKit', 'SystemConfiguration', 'UIKit'
s.ios.frameworks = 'CoreTelephony'
s.frameworks = 'Security', 'StoreKit', 'SystemConfiguration', 'UIKit'

s.source_files = [
'Analytics/Classes/**/*',
Expand Down
13 changes: 11 additions & 2 deletions Analytics.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
3481C14AEC76E5A8DA64DA59 /* Pods_AnalyticsTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 89033CBF22319674E6CE7E61 /* Pods_AnalyticsTests.framework */; };
6E265C791FB1178C0030E08E /* IntegrationsManagerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E265C781FB1178C0030E08E /* IntegrationsManagerTest.swift */; };
6EEC1C712017EA370089C478 /* EndToEndTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EEC1C702017EA370089C478 /* EndToEndTests.swift */; };
A31958EF2385AC3A00A47EFA /* SerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A31958EE2385AC3A00A47EFA /* SerializationTests.m */; };
A352176023AD5825005B07F6 /* SEGMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = A352175F23AD5825005B07F6 /* SEGMacros.h */; settings = {ATTRIBUTES = (Private, ); }; };
EA88A5981DED7608009FB66A /* SEGSerializableValue.h in Headers */ = {isa = PBXBuildFile; fileRef = EA88A5971DED7608009FB66A /* SEGSerializableValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
EA8F09741E24C5C600B8B93F /* MiddlewareTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA8F09731E24C5C600B8B93F /* MiddlewareTests.swift */; };
EAA542771EB4035400945DA7 /* TrackingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAA542761EB4035400945DA7 /* TrackingTests.swift */; };
Expand Down Expand Up @@ -92,6 +94,8 @@
6E265C781FB1178C0030E08E /* IntegrationsManagerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntegrationsManagerTest.swift; sourceTree = "<group>"; };
6EEC1C702017EA370089C478 /* EndToEndTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EndToEndTests.swift; sourceTree = "<group>"; };
89033CBF22319674E6CE7E61 /* Pods_AnalyticsTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_AnalyticsTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A31958EE2385AC3A00A47EFA /* SerializationTests.m */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = SerializationTests.m; sourceTree = "<group>"; tabWidth = 4; };
A352175F23AD5825005B07F6 /* SEGMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SEGMacros.h; sourceTree = "<group>"; };
D3BF8AE673FE0FD91DF5B503 /* Pods-AnalyticsTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AnalyticsTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-AnalyticsTests/Pods-AnalyticsTests.release.xcconfig"; sourceTree = "<group>"; };
EA88A5971DED7608009FB66A /* SEGSerializableValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SEGSerializableValue.h; sourceTree = "<group>"; };
EA8F09731E24C5C600B8B93F /* MiddlewareTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MiddlewareTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -266,6 +270,7 @@
EADEB8EC1DECD335005322DA /* AnalyticsTests-Bridging-Header.h */,
6E265C781FB1178C0030E08E /* IntegrationsManagerTest.swift */,
6EEC1C702017EA370089C478 /* EndToEndTests.swift */,
A31958EE2385AC3A00A47EFA /* SerializationTests.m */,
);
indentWidth = 2;
path = AnalyticsTests;
Expand Down Expand Up @@ -344,6 +349,7 @@
EADEB89F1DECD12B005322DA /* SEGUserDefaultsStorage.m */,
EADEB8A01DECD12B005322DA /* SEGUtils.h */,
EADEB8A11DECD12B005322DA /* SEGUtils.m */,
A352175F23AD5825005B07F6 /* SEGMacros.h */,
EADEB8A21DECD12B005322DA /* UIViewController+SEGScreen.h */,
EADEB8A31DECD12B005322DA /* UIViewController+SEGScreen.m */,
);
Expand Down Expand Up @@ -407,6 +413,7 @@
EADEB8DE1DECD12B005322DA /* SEGAnalyticsConfiguration.h in Headers */,
EADEB8D61DECD12B005322DA /* UIViewController+SEGScreen.h in Headers */,
EADEB8CF1DECD12B005322DA /* SEGStorage.h in Headers */,
A352176023AD5825005B07F6 /* SEGMacros.h in Headers */,
EADEB8D21DECD12B005322DA /* SEGUserDefaultsStorage.h in Headers */,
EADEB8D01DECD12B005322DA /* SEGStoreKitTracker.h in Headers */,
EADEB8D41DECD12B005322DA /* SEGUtils.h in Headers */,
Expand Down Expand Up @@ -486,6 +493,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = EADEB8511DECD080005322DA;
Expand Down Expand Up @@ -541,7 +549,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-AnalyticsTests/Pods-AnalyticsTests-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-AnalyticsTests/Pods-AnalyticsTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/Alamofire-Synchronous/Alamofire_Synchronous.framework",
"${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework",
Expand All @@ -560,7 +568,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AnalyticsTests/Pods-AnalyticsTests-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AnalyticsTests/Pods-AnalyticsTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -604,6 +612,7 @@
EADEB8F21DECD335005322DA /* UserDefaultsStorageTest.swift in Sources */,
EAA542771EB4035400945DA7 /* TrackingTests.swift in Sources */,
EADEB8F41DECD335005322DA /* ContextTest.swift in Sources */,
A31958EF2385AC3A00A47EFA /* SerializationTests.m in Sources */,
EADEB8EE1DECD335005322DA /* HTTPClientTest.swift in Sources */,
EADEB8F31DECD335005322DA /* AnalyticsTests.swift in Sources */,
EADEB8F11DECD335005322DA /* FileStorageTest.swift in Sources */,
Expand Down
24 changes: 9 additions & 15 deletions Analytics.xcodeproj/xcshareddata/xcschemes/Analytics.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EADEB85A1DECD080005322DA"
BuildableName = "Analytics.framework"
BlueprintName = "Analytics"
ReferencedContainer = "container:Analytics.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -41,23 +49,11 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EADEB85A1DECD080005322DA"
BuildableName = "Analytics.framework"
BlueprintName = "Analytics"
ReferencedContainer = "container:Analytics.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand All @@ -73,8 +69,6 @@
ReferencedContainer = "container:Analytics.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
30 changes: 12 additions & 18 deletions Analytics.xcodeproj/xcshareddata/xcschemes/AnalyticsTests.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "NO">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EADEB8691DECD0EF005322DA"
BuildableName = "AnalyticsTests.xctest"
BlueprintName = "AnalyticsTests"
ReferencedContainer = "container:Analytics.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -45,22 +32,29 @@
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EADEB8691DECD0EF005322DA"
BuildableName = "AnalyticsTests.xctest"
BlueprintName = "AnalyticsTests"
ReferencedContainer = "container:Analytics.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
1 change: 1 addition & 0 deletions Analytics/Classes/Integrations/SEGIntegrationsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ extern NSString *_Nonnull SEGAnalyticsIntegrationDidStart;
@interface SEGIntegrationsManager : NSObject

// Exposed for testing.
+ (BOOL)isIntegration:(NSString *_Nonnull)key enabledInOptions:(NSDictionary *_Nonnull)options;
+ (BOOL)isTrackEvent:(NSString *_Nonnull)event enabledForIntegration:(NSString *_Nonnull)key inPlan:(NSDictionary *_Nonnull)plan;

// @Deprecated - Exposing for backward API compat reasons only
Expand Down
14 changes: 13 additions & 1 deletion Analytics/Classes/Integrations/SEGIntegrationsManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,19 @@ + (BOOL)isIntegration:(NSString *)key enabledInOptions:(NSDictionary *)options
return YES;
}
if (options[key]) {
return [options[key] boolValue];
id value = options[key];

// it's been observed that customers sometimes override this with
// value's that aren't bool types.
if ([value isKindOfClass:[NSNumber class]]) {
NSNumber *numberValue = (NSNumber *)value;
return [numberValue boolValue];
} else {
NSString *msg = [NSString stringWithFormat: @"Value for `%@` in integration options is supposed to be a boolean and it is not!"
"This is likely due to a user-added value in `integrations` that overwrites a value received from the server", key];
SEGLog(msg);
NSAssert(NO, msg);
}
} else if (options[@"All"]) {
return [options[@"All"] boolValue];
} else if (options[@"all"]) {
Expand Down
15 changes: 15 additions & 0 deletions Analytics/Classes/Internal/SEGAnalyticsUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ NS_ASSUME_NONNULL_BEGIN

NSString *GenerateUUIDString(void);

// Validation Utils
BOOL serializableDictionaryTypes(NSDictionary *dict);

// Date Utils
NSString *iso8601FormattedString(NSDate *date);

Expand Down Expand Up @@ -33,4 +36,16 @@ NSString *_Nullable SEGIDFA(void);

NSString *SEGEventNameForScreenTitle(NSString *title);

// Deep copy and check NSCoding conformance
@protocol SEGSerializableDeepCopy <NSObject>
-(id _Nullable) serializableDeepCopy;
@end

@interface NSDictionary(SerializableDeepCopy) <SEGSerializableDeepCopy>
@end

@interface NSArray(SerializableDeepCopy) <SEGSerializableDeepCopy>
@end


NS_ASSUME_NONNULL_END
Loading