Skip to content

Commit

Permalink
Adds WatchKit support via CocoaPods
Browse files Browse the repository at this point in the history
  • Loading branch information
leoAsana committed Nov 6, 2019
1 parent 470748e commit 501979f
Show file tree
Hide file tree
Showing 25 changed files with 1,273 additions and 106 deletions.
63 changes: 39 additions & 24 deletions Snowplow.xcodeproj/project.pbxproj
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 51;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -61,11 +61,7 @@
754774C12225FBB90043B814 /* SPScreenState.h in Headers */ = {isa = PBXBuildFile; fileRef = 754774BF2225FBB90043B814 /* SPScreenState.h */; };
754774C22225FBB90043B814 /* SPScreenState.h in Headers */ = {isa = PBXBuildFile; fileRef = 754774BF2225FBB90043B814 /* SPScreenState.h */; };
754774CD222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.h in Headers */ = {isa = PBXBuildFile; fileRef = 754774CB222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.h */; settings = {ATTRIBUTES = (Private, ); }; };
754774CE222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.h in Headers */ = {isa = PBXBuildFile; fileRef = 754774CB222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.h */; };
754774CF222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.h in Headers */ = {isa = PBXBuildFile; fileRef = 754774CB222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.h */; };
754774D0222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.m in Sources */ = {isa = PBXBuildFile; fileRef = 754774CC222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.m */; };
754774D1222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.m in Sources */ = {isa = PBXBuildFile; fileRef = 754774CC222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.m */; };
754774D2222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.m in Sources */ = {isa = PBXBuildFile; fileRef = 754774CC222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.m */; };
75CAC40521F2955100271FB3 /* TestSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 75CAC3F121F2955000271FB3 /* TestSession.m */; };
75CAC40621F2955100271FB3 /* TestEventStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 75CAC3F221F2955000271FB3 /* TestEventStore.m */; };
75CAC40721F2955100271FB3 /* TestPayload.m in Sources */ = {isa = PBXBuildFile; fileRef = 75CAC3F321F2955000271FB3 /* TestPayload.m */; };
Expand Down Expand Up @@ -186,6 +182,7 @@
75F9C5F221FA35BC00A5B8FC /* SPRequestCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 049B2BDA1B7A203200BD82FC /* SPRequestCallback.h */; settings = {ATTRIBUTES = (Public, ); }; };
983E071016B9F2C9D795C9D2 /* libPods-Snowplow-macOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D39577C915882506F76CFA74 /* libPods-Snowplow-macOS.a */; };
9EAA4A623333558D3B0CE765 /* libPods-Snowplow-iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2904EB4D15396D06F947D8C /* libPods-Snowplow-iOS.a */; };
D8B28367B35E107A44B5F776 /* libPods-Snowplow-watchOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D33B3CAA7537C0DF4D1D36C0 /* libPods-Snowplow-watchOS.a */; };
DDC5D9041D6E4E059D2ABECC /* libPods-Snowplow-macOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 28BF19FC691D361DC65685A9 /* libPods-Snowplow-macOSTests.a */; };
F4F03A888AB1E732E1353F09 /* libPods-Snowplow-iOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8CC6F0EC5182C6B14D03E947 /* libPods-Snowplow-iOSTests.a */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -262,9 +259,11 @@
049B2BDA1B7A203200BD82FC /* SPRequestCallback.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPRequestCallback.h; sourceTree = "<group>"; };
17E4CF0C9ECDF825CE683033 /* Pods-Snowplow-macOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-macOSTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Snowplow-macOSTests/Pods-Snowplow-macOSTests.debug.xcconfig"; sourceTree = "<group>"; };
28BF19FC691D361DC65685A9 /* libPods-Snowplow-macOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Snowplow-macOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3ECF84ED6FC265BA42E71D4D /* Pods-Snowplow-watchOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-watchOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Snowplow-watchOS/Pods-Snowplow-watchOS.debug.xcconfig"; sourceTree = "<group>"; };
5ABE526A6BE3015F24971BDD /* Pods-Snowplow-iOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-iOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Snowplow-iOSTests/Pods-Snowplow-iOSTests.release.xcconfig"; sourceTree = "<group>"; };
61536FB3FEDC308DB428EF73 /* Pods-Snowplow-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-iOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-Snowplow-iOS/Pods-Snowplow-iOS.release.xcconfig"; sourceTree = "<group>"; };
6607FF014C01079F941D6706 /* Pods-Snowplow-iOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-iOSTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Snowplow-iOSTests/Pods-Snowplow-iOSTests.debug.xcconfig"; sourceTree = "<group>"; };
71CD2326050368A99BDEB01F /* Pods-Snowplow-watchOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-watchOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-Snowplow-watchOS/Pods-Snowplow-watchOS.release.xcconfig"; sourceTree = "<group>"; };
750E7F1121F2735C0050A993 /* Nocilla.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Nocilla.framework; path = Carthage/Build/iOS/Nocilla.framework; sourceTree = "<group>"; };
75264A2F224E5DBC000E0E9B /* SPInstallTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPInstallTracker.h; sourceTree = "<group>"; };
75264A31224E5DD2000E0E9B /* SPInstallTracker.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SPInstallTracker.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -331,6 +330,7 @@
B5D6F3169FDAE95A3095EB77 /* Pods-Snowplow-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Snowplow-iOS/Pods-Snowplow-iOS.debug.xcconfig"; sourceTree = "<group>"; };
D2904EB4D15396D06F947D8C /* libPods-Snowplow-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Snowplow-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
D2E81238FF66A542FBCD30A2 /* Pods-Snowplow-macOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Snowplow-macOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-Snowplow-macOSTests/Pods-Snowplow-macOSTests.release.xcconfig"; sourceTree = "<group>"; };
D33B3CAA7537C0DF4D1D36C0 /* libPods-Snowplow-watchOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Snowplow-watchOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
D39577C915882506F76CFA74 /* libPods-Snowplow-macOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Snowplow-macOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -369,6 +369,7 @@
752DAC1121CC3F020065F874 /* FMDB.framework in Frameworks */,
75CAC46721F2A25B00271FB3 /* CoreTelephony.framework in Frameworks */,
75CAC46921F2A25B00271FB3 /* Foundation.framework in Frameworks */,
D8B28367B35E107A44B5F776 /* libPods-Snowplow-watchOS.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -500,6 +501,7 @@
8CC6F0EC5182C6B14D03E947 /* libPods-Snowplow-iOSTests.a */,
D39577C915882506F76CFA74 /* libPods-Snowplow-macOS.a */,
28BF19FC691D361DC65685A9 /* libPods-Snowplow-macOSTests.a */,
D33B3CAA7537C0DF4D1D36C0 /* libPods-Snowplow-watchOS.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -566,6 +568,8 @@
907F5C2E8601E4A9AD270720 /* Pods-Snowplow-macOS.release.xcconfig */,
17E4CF0C9ECDF825CE683033 /* Pods-Snowplow-macOSTests.debug.xcconfig */,
D2E81238FF66A542FBCD30A2 /* Pods-Snowplow-macOSTests.release.xcconfig */,
3ECF84ED6FC265BA42E71D4D /* Pods-Snowplow-watchOS.debug.xcconfig */,
71CD2326050368A99BDEB01F /* Pods-Snowplow-watchOS.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
Expand Down Expand Up @@ -612,7 +616,6 @@
754774C12225FBB90043B814 /* SPScreenState.h in Headers */,
75CAC46121F2A21B00271FB3 /* SPUtilities.h in Headers */,
75CAC46421F2A21B00271FB3 /* SPEvent.h in Headers */,
754774CE222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.h in Headers */,
75CAC46521F2A21B00271FB3 /* SPRequestCallback.h in Headers */,
75CAC46621F2A22500271FB3 /* OpenIDFA.h in Headers */,
75CAC45D21F2A21B00271FB3 /* SPSession.h in Headers */,
Expand All @@ -637,7 +640,6 @@
75CAC43721F2A0CC00271FB3 /* SPRequestCallback.h in Headers */,
754774C22225FBB90043B814 /* SPScreenState.h in Headers */,
75CAC43821F2A0CC00271FB3 /* Snowplow-Bridging-Header.h in Headers */,
754774CF222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.h in Headers */,
75CAC42F21F2A0CC00271FB3 /* SPSession.h in Headers */,
75CAC43221F2A0CC00271FB3 /* SPEventStore.h in Headers */,
75CAC43421F2A0CC00271FB3 /* SPRequestResponse.h in Headers */,
Expand Down Expand Up @@ -717,6 +719,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 752DABED21CC3A090065F874 /* Build configuration list for PBXNativeTarget "Snowplow-watchOS" */;
buildPhases = (
FD35A08A1692057727BBABD3 /* [CP] Check Pods Manifest.lock */,
752DABE321CC3A090065F874 /* Headers */,
752DABE421CC3A090065F874 /* Sources */,
752DABE521CC3A090065F874 /* Frameworks */,
Expand Down Expand Up @@ -923,20 +926,15 @@
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Snowplow-macOSTests/Pods-Snowplow-macOSTests-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/SnowplowIgluClient-macOS/SnowplowIgluResources.bundle",
"${PODS_ROOT}/Target Support Files/Pods-Snowplow-macOSTests/Pods-Snowplow-macOSTests-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
);
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SnowplowIgluResources.bundle",
"${PODS_ROOT}/Target Support Files/Pods-Snowplow-macOSTests/Pods-Snowplow-macOSTests-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Snowplow-macOSTests/Pods-Snowplow-macOSTests-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Snowplow-macOSTests/Pods-Snowplow-macOSTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
98681E02A562506D55F4D55E /* [CP] Check Pods Manifest.lock */ = {
Expand All @@ -962,28 +960,45 @@
showEnvVarsInLog = 0;
};
D44F1066E50A517200A43ED4 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Snowplow-iOSTests/Pods-Snowplow-iOSTests-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Snowplow-iOSTests/Pods-Snowplow-iOSTests-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Snowplow-iOSTests/Pods-Snowplow-iOSTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
D7A349C98101434299B0064C /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Snowplow-iOSTests/Pods-Snowplow-iOSTests-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/SnowplowIgluClient-iOS/SnowplowIgluResources.bundle",
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Copy Pods Resources";
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SnowplowIgluResources.bundle",
"$(DERIVED_FILE_DIR)/Pods-Snowplow-iOS-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Snowplow-iOSTests/Pods-Snowplow-iOSTests-resources.sh\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
D7A349C98101434299B0064C /* [CP] Check Pods Manifest.lock */ = {
FD35A08A1692057727BBABD3 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -998,7 +1013,7 @@
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Snowplow-iOS-checkManifestLockResult.txt",
"$(DERIVED_FILE_DIR)/Pods-Snowplow-watchOS-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -1058,7 +1073,6 @@
buildActionMask = 2147483647;
files = (
75CAC43A21F2A17500271FB3 /* Snowplow.m in Sources */,
754774D1222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.m in Sources */,
754774BD2225FBA60043B814 /* SPScreenState.m in Sources */,
75CAC43B21F2A17500271FB3 /* SPTracker.m in Sources */,
75CAC43C21F2A17500271FB3 /* SPEmitter.m in Sources */,
Expand All @@ -1081,7 +1095,6 @@
files = (
75CAC44821F2A19500271FB3 /* Snowplow.m in Sources */,
754774BE2225FBA60043B814 /* SPScreenState.m in Sources */,
754774D2222756470043B814 /* UIViewController+SPScreenView_SWIZZLE.m in Sources */,
75CAC44921F2A19500271FB3 /* SPTracker.m in Sources */,
75CAC44A21F2A19500271FB3 /* SPEmitter.m in Sources */,
75CAC44B21F2A19500271FB3 /* SPSubject.m in Sources */,
Expand Down Expand Up @@ -1388,6 +1401,7 @@
};
752DABEE21CC3A090065F874 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3ECF84ED6FC265BA42E71D4D /* Pods-Snowplow-watchOS.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
APPLICATION_EXTENSION_API_ONLY = YES;
Expand Down Expand Up @@ -1443,6 +1457,7 @@
};
752DABEF21CC3A090065F874 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 71CD2326050368A99BDEB01F /* Pods-Snowplow-watchOS.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
APPLICATION_EXTENSION_API_ONLY = YES;
Expand Down
43 changes: 28 additions & 15 deletions Snowplow/SPEmitter.m
Expand Up @@ -326,22 +326,35 @@ - (void) sendEvents {
}

- (void) sendEventWithRequest:(NSMutableURLRequest *)request andIndex:(NSArray *)indexArray andResultArray:(NSMutableArray *)results andOversize:(BOOL)oversize {
[_dataOperationQueue addOperationWithBlock:^{
NSHTTPURLResponse *response = nil;
NSError *connectionError = nil;
[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&connectionError];

@synchronized (results) {
if (oversize) {
[results addObject:[[SPRequestResponse alloc] initWithBool:true withIndex:indexArray]];
} else if ([response statusCode] >= 200 && [response statusCode] < 300) {
[results addObject:[[SPRequestResponse alloc] initWithBool:true withIndex:indexArray]];
} else {
NSLog(@"SPLog: Error: %@", connectionError);
[results addObject:[[SPRequestResponse alloc] initWithBool:false withIndex:indexArray]];
[_dataOperationQueue addOperationWithBlock:^{
//source: https://forums.developer.apple.com/thread/11519
__block NSHTTPURLResponse *httpResponse = nil;
__block NSError *connectionError = nil;
dispatch_semaphore_t sem;

sem = dispatch_semaphore_create(0);

[[[NSURLSession sharedSession] dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *urlResponse, NSError *error) {

connectionError = error;
httpResponse = (NSHTTPURLResponse*)urlResponse;
dispatch_semaphore_signal(sem);
}] resume];

dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);

@synchronized (results) {
if (oversize) {
[results addObject:[[SPRequestResponse alloc] initWithBool:true withIndex:indexArray]];
} else if ([httpResponse statusCode] >= 200 && [httpResponse statusCode] < 300) {
[results addObject:[[SPRequestResponse alloc] initWithBool:true withIndex:indexArray]];
} else {
NSLog(@"SPLog: Error: %@", connectionError);
[results addObject:[[SPRequestResponse alloc] initWithBool:false withIndex:indexArray]];
}
}
}
}];
}];
}

- (void) processSuccessesWithResults:(NSArray *)indexArray {
Expand Down
11 changes: 11 additions & 0 deletions Snowplow/SPUtilities.m
Expand Up @@ -45,6 +45,10 @@

#import <UIKit/UIScreen.h>

#elif SNOWPLOW_TARGET_WATCHOS

#import <WatchKit/WatchKit.h>

#endif

@implementation SPUtilities
Expand Down Expand Up @@ -150,6 +154,9 @@ + (NSString *) getResolution {
#if SNOWPLOW_TARGET_IOS || SNOWPLOW_TARGET_TV
CGRect mainScreen = [[UIScreen mainScreen] bounds];
CGFloat screenScale = [[UIScreen mainScreen] scale];
#elif SNOWPLOW_TARGET_WATCHOS
CGRect mainScreen = [[WKInterfaceDevice currentDevice] screenBounds];
CGFloat screenScale = 1;//[[UIScreen mainScreen] scale];
#else
CGRect mainScreen = [[NSScreen mainScreen] frame];
CGFloat screenScale = [[NSScreen mainScreen] backingScaleFactor];
Expand All @@ -172,6 +179,8 @@ + (NSString *) getDeviceVendor {
+ (NSString *) getDeviceModel {
#if SNOWPLOW_TARGET_IOS || SNOWPLOW_TARGET_TV
return [[UIDevice currentDevice] model];
#elif SNOWPLOW_TARGET_WATCHOS
return [[WKInterfaceDevice currentDevice] model];
#else
size_t size;
char *model = nil;
Expand All @@ -187,6 +196,8 @@ + (NSString *) getDeviceModel {
+ (NSString *) getOSVersion {
#if SNOWPLOW_TARGET_IOS || SNOWPLOW_TARGET_TV
return [[UIDevice currentDevice] systemVersion];
#elif SNOWPLOW_TARGET_WATCHOS
return [[WKInterfaceDevice currentDevice] systemVersion];
#else
SInt32 osxMajorVersion;
SInt32 osxMinorVersion;
Expand Down
11 changes: 11 additions & 0 deletions SnowplowSwiftDemo/Podfile
Expand Up @@ -21,3 +21,14 @@ target 'SnowplowSwiftDemo' do
# Pods for testing
end
end

target 'SnowplowSwiftDemoWatch WatchKit Extension' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!

platform :watchos, '2.0'

# Pods for SnowplowSwiftDemo

pod 'SnowplowTracker', :path => '../'
end

0 comments on commit 501979f

Please sign in to comment.