Skip to content

Commit

Permalink
Merge 7e57580 into f036187
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexBenny committed Nov 26, 2019
2 parents f036187 + 7e57580 commit 096f90b
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 32 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Expand Up @@ -4,7 +4,7 @@ osx_image: xcode11.2
env:
global:
- secure: H45yyUlB0cXQrzTTcnmD3WrkCyqjUzaop2jHgmBF3bm8ue4XOcTWKDSDcAN39SG0FUeDC7GdDCtWAc3VCpLwN++5IznAnvBuZSGgxQ2lCxWMhdTtXtOWU2mivgVvs+uldS7/TuVlOjZ7inrTgetl+jgFjenwESOGIIZwn7SXpPo=
- BUILD_DEST="platform=iOS Simulator,OS=13.2,name=iPhone 8"
- BUILD_DEST="platform=iOS Simulator,OS=13.2.2,name=iPhone 8"
- BUILD_PROJECT_LIB="-project Snowplow.xcodeproj"
- BUILD_SCHEME_LIB="-scheme Snowplow-iOS"
- BUILD_WORKSPACE_OBJC_DEMO="-workspace SnowplowDemo.xcworkspace"
Expand All @@ -13,9 +13,6 @@ env:
- BUILD_PROJECT_SWIFT_DEMO="-project SnowplowSwiftDemo.xcodeproj"
- BUILD_SCHEME_SWIFT_DEMO="-scheme SnowplowSwiftDemo"

rvm:
- 2.3.7

before_install:
- gem install slather
- gem install xcpretty -N --no-document
Expand Down
21 changes: 13 additions & 8 deletions CHANGELOG
@@ -1,13 +1,18 @@
Version 1.1.5 (2019-11-25)
--------------------------
Fix travis script not able to test on iOS 13.2 (#472)
Fix IDFA rejection when app submitted with v.1.1.4 (#470)

Version 1.1.4 (2019-11-11)
--------------------------
Fix doc of method setTimestamp (close #467)
Set simulator device model information when it runs on simulator (close #468)
Update swift demo app for 1.1.4 (close #460)
Update objc demo app for 1.1.4 (close #461)
Fix Slather (close #453)
SnowplowTracker-swift.h file not found static lib building (close #427)
Fix building issues on MacOS target (close #466)
Fix bridging issues importing the framework on swift demo app (close #458)
Fix doc of method setTimestamp (#467)
Set simulator device model information when it runs on simulator (#468)
Update swift demo app for 1.1.4 (#460)
Update objc demo app for 1.1.4 (#461)
Fix Slather (#453)
SnowplowTracker-swift.h file not found static lib building (#427)
Fix building issues on MacOS target (#466)
Fix bridging issues importing the framework on swift demo app (#458)
Fix installation of SnowplowTracker via Carthage (#457)
Fix Nocilla at 0.11 (#455)
Comply with isAdvertisingTrackingEnabled (#447)
Expand Down
10 changes: 4 additions & 6 deletions Snowplow iOSTests/TestUtils.m
Expand Up @@ -21,6 +21,7 @@
//

#import <XCTest/XCTest.h>
#import <AdSupport/AdSupport.h>
#import "SPUtilities.h"
#import "Snowplow.h"

Expand Down Expand Up @@ -88,12 +89,10 @@ - (void)testGetEventId {
@"UUID generated doesn't match the type 4 UUID RFC");
}

/**
This is always NULL as we do not have the AdSupport imported
- (void)testGetAppleIdfa {
NSString *sample_uuid = [SPUtils getAppleIdfa];
// The simulator running the test must have "limit ad tracking" disabled.
// (You can find it in the Simulator: Settings > Privacy > Advertising > Limit Ad Tracking > Set to False)
NSString *sample_uuid = [SPUtilities getAppleIdfa];

// For regex pattern matching to verify if it's of UUID type 4
NSString *pattern = @"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}";
Expand All @@ -105,7 +104,6 @@ - (void)testGetAppleIdfa {
XCTAssertEqual([matches count], (NSUInteger)1,
@"UUID generated doesn't match the type 4 UUID RFC");
}
*/

- (void)testGetOpenIdfa {
NSString *sample_uuid = [SPUtilities getOpenIdfa];
Expand Down
4 changes: 4 additions & 0 deletions Snowplow.xcodeproj/project.pbxproj
Expand Up @@ -180,6 +180,7 @@
75F9C5F021FA35BC00A5B8FC /* SPWeakTimerTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 044CA88B1B94791E000EA3B1 /* SPWeakTimerTarget.h */; settings = {ATTRIBUTES = (Private, ); }; };
75F9C5F121FA35BC00A5B8FC /* SPEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0402EBEB1BA93CA5006C8818 /* SPEvent.h */; settings = {ATTRIBUTES = (Public, ); }; };
75F9C5F221FA35BC00A5B8FC /* SPRequestCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 049B2BDA1B7A203200BD82FC /* SPRequestCallback.h */; settings = {ATTRIBUTES = (Public, ); }; };
ED26E6BA23842AB00096AF7C /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED26E6B923842AAF0096AF7C /* AdSupport.framework */; };
ED8A3EEC2371708C00E51827 /* SPInstallTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 75264A31224E5DD2000E0E9B /* SPInstallTracker.m */; };
ED8A3EED2371709100E51827 /* SPInstallTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 75264A2F224E5DBC000E0E9B /* SPInstallTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -314,6 +315,7 @@
ABB767AF194974D3006275D1 /* SPEventStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPEventStore.m; sourceTree = "<group>"; };
ABFCC3741922984A00FAE8FE /* SPUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUtilities.h; sourceTree = "<group>"; };
ABFCC3751922984A00FAE8FE /* SPUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUtilities.m; sourceTree = "<group>"; };
ED26E6B923842AAF0096AF7C /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AdSupport.framework; sourceTree = DEVELOPER_DIR; };
ED6AC5152369D42800A8F8A3 /* ios.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = ios.modulemap; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand All @@ -333,6 +335,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
ED26E6BA23842AB00096AF7C /* AdSupport.framework in Frameworks */,
23DFEC832362FAF800BD19C4 /* VVJSONSchemaValidation.framework in Frameworks */,
23DFEC822362FAED00BD19C4 /* SnowplowIgluClient.framework in Frameworks */,
23DFEC812362FAE200BD19C4 /* Reachability.framework in Frameworks */,
Expand Down Expand Up @@ -462,6 +465,7 @@
AB0C27BF191B408200018557 /* Frameworks */ = {
isa = PBXGroup;
children = (
ED26E6B923842AAF0096AF7C /* AdSupport.framework */,
753DDA6C21F803B10007C3AE /* Cocoa.framework */,
75CAC3C021F2930100271FB3 /* VVJSONSchemaValidation.framework */,
75CAC3B921F28BD600271FB3 /* SnowplowIgluClient.framework */,
Expand Down
2 changes: 1 addition & 1 deletion Snowplow/SPUtilities.h
Expand Up @@ -74,7 +74,7 @@
+ (NSString *) getOpenIdfa;

/*!
@brief Returns a generated string unique to each device, used only for serving advertisements. This works only if you have the AdSupport library in your project. If you have it, but do not want to use IDFA, add the complier flag <code>SNOWPLOW_NO_IFA</code> to your build settings.
@brief Returns a generated string unique to each device, used only for serving advertisements. This works only if you have the AdSupport library in your project. If you have it, but do not want to use IDFA, add the compiler flag <code>SNOWPLOW_NO_IFA</code> to your build settings.
@return A string containing a formatted UUID for example E621E1F8-C36C-495A-93FC-0C247A3E6E5F.
*/
Expand Down
38 changes: 30 additions & 8 deletions Snowplow/SPUtilities.m
Expand Up @@ -29,7 +29,6 @@

#if SNOWPLOW_TARGET_IOS

@import AdSupport;
#import "OpenIDFA.h"
#import <UIKit/UIScreen.h>
#import <CoreTelephony/CTCarrier.h>
Expand All @@ -49,7 +48,6 @@

#elif SNOWPLOW_TARGET_TV

@import AdSupport;
#import <UIKit/UIScreen.h>

#endif
Expand Down Expand Up @@ -90,17 +88,41 @@ + (NSString *) getOpenIdfa {
return idfa;
}

/*
The IDFA can be retrieved using selectors rather than proper instance methods because
the compiler would complain about the missing AdSupport framework.
As stated in the header file, this only works if you have the AdSupport library in your project.
If you have it, but do not want to use IDFA, add the compiler flag <code>SNOWPLOW_NO_IFA</code> to your build settings.
If you haven't AdSupport framework in your project it just compiles returning a nil advertisingIdentifier.
Note that `advertisingIdentifier` returns a sequence of 0s when used in the simulator.
Use a real device if you want a proper IDFA.
*/
+ (NSString *) getAppleIdfa {
NSString* idfa = nil;
#if SNOWPLOW_TARGET_IOS || SNOWPLOW_TARGET_TV
#ifndef SNOWPLOW_NO_IFA
if([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) {
NSUUID *identifier = [[ASIdentifierManager sharedManager] advertisingIdentifier];
idfa = [identifier UUIDString];
}
Class ASIdentifierManagerClass = NSClassFromString(@"ASIdentifierManager");
if (!ASIdentifierManagerClass) return nil;

SEL sharedManagerSelector = NSSelectorFromString(@"sharedManager");
if (![ASIdentifierManagerClass respondsToSelector:sharedManagerSelector]) return nil;

id sharedManager = ((id (*)(id, SEL))[ASIdentifierManagerClass methodForSelector:sharedManagerSelector])(ASIdentifierManagerClass, sharedManagerSelector);

SEL isAdvertisingTrackingEnabledSelector = NSSelectorFromString(@"isAdvertisingTrackingEnabled");
if (![sharedManager respondsToSelector:isAdvertisingTrackingEnabledSelector]) return nil;

BOOL isAdvertisingTrackingEnabled = ((BOOL (*)(id, SEL))[sharedManager methodForSelector:isAdvertisingTrackingEnabledSelector])(sharedManager, isAdvertisingTrackingEnabledSelector);
if (!isAdvertisingTrackingEnabled) return nil;

SEL advertisingIdentifierSelector = NSSelectorFromString(@"advertisingIdentifier");
if (![sharedManager respondsToSelector:advertisingIdentifierSelector]) return nil;

NSUUID *uuid = ((NSUUID* (*)(id, SEL))[sharedManager methodForSelector:advertisingIdentifierSelector])(sharedManager, advertisingIdentifierSelector);
return [uuid UUIDString];
#endif
#endif
return idfa;
return nil;
}

+ (NSString *) getAppleIdfv {
Expand Down
6 changes: 3 additions & 3 deletions Snowplow/Snowplow.m
Expand Up @@ -27,11 +27,11 @@ @implementation Snowplow
// --- Version

#if SNOWPLOW_TARGET_IOS
NSString * const kSPVersion = @"ios-1.1.4";
NSString * const kSPVersion = @"ios-1.1.5";
#elif SNOWPLOW_TARGET_TV
NSString * const kSPVersion = @"tvos-1.1.4";
NSString * const kSPVersion = @"tvos-1.1.5";
#else
NSString * const kSPVersion = @"osx-1.1.4";
NSString * const kSPVersion = @"osx-1.1.5";
#endif

// --- Emitter
Expand Down
2 changes: 1 addition & 1 deletion SnowplowTracker.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SnowplowTracker"
s.version = "1.1.4"
s.version = "1.1.5"
s.summary = "Snowplow event tracker for iOS 7+. Add analytics to your iOS apps and games."
s.description = <<-DESC
Snowplow is a mobile and event analytics platform with a difference: rather than tell our users how they should analyze their data, we deliver their event-level data in their own data warehouse, on their own Amazon Redshift or Postgres database, so they can analyze it any way they choose. Snowplow mobile is used by data-savvy games companies and app developers to better understand their users and how they engage with their games and applications. Snowplow is open source using the business-friendly Apache License, Version 2.0 and scales horizontally to many billions of events.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.1.4
1.1.5

0 comments on commit 096f90b

Please sign in to comment.