diff --git a/.gitignore b/.gitignore index 77d5e1a..b666f24 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,9 @@ DerivedData # emacs *~ +# Cocoapods +Example/Podfile.lock + Carthage # We recommend against adding the Pods directory to your .gitignore. However # you should judge for yourself, the pros and cons are mentioned at: diff --git a/CHANGELOG.md b/CHANGELOG.md index 1144d01..e94117a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Change Log ========== +Version 1.0.2 *(March, 2016)* +------------------------------------------- +*(Supports analytics-ios 3.0.+ and Appboy 2.19.1+)* + +- Adds support for custom attribute values with short, long, and float types. +- Modifies `SEGAppboyIntegrationFactory`'s `instance` method to return an `instancetype` for simpler Swift integration. + Version 1.0.1 *(March, 2016)* ------------------------------------------- *(Supports analytics-ios 3.0.+ and Appboy 2.18.2+)* diff --git a/Example/Podfile.lock b/Example/Podfile.lock deleted file mode 100644 index 6562178..0000000 --- a/Example/Podfile.lock +++ /dev/null @@ -1,35 +0,0 @@ -PODS: - - Analytics (3.0.7) - - Appboy-iOS-SDK (2.18.3): - - SDWebImage (~> 3.7.0) - - Expecta (1.0.5) - - OCMock (3.2.2) - - SDWebImage (3.7.5): - - SDWebImage/Core (= 3.7.5) - - SDWebImage/Core (3.7.5) - - Segment-Appboy (1.0.0): - - Analytics (~> 3.0.0) - - Appboy-iOS-SDK - - Specta (1.0.5) - -DEPENDENCIES: - - Analytics - - Expecta - - OCMock - - Segment-Appboy (from `../`) - - Specta - -EXTERNAL SOURCES: - Segment-Appboy: - :path: "../" - -SPEC CHECKSUMS: - Analytics: b342fb4f43fa4f97ca6f4358b44d3295217ba294 - Appboy-iOS-SDK: 9ed4afbb26914e0bd5f7903ea089a8d3930aac56 - Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe - OCMock: 18c9b7e67d4c2770e95bb77a9cc1ae0c91fe3835 - SDWebImage: 69c6303e3348fba97e03f65d65d4fbc26740f461 - Segment-Appboy: e312a62990fdd69324cca27c640b932c8bd0ca0b - Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2 - -COCOAPODS: 0.39.0 diff --git a/Example/Segment-Appboy.xcodeproj/project.pbxproj b/Example/Segment-Appboy.xcodeproj/project.pbxproj index 14e7bed..2161a26 100644 --- a/Example/Segment-Appboy.xcodeproj/project.pbxproj +++ b/Example/Segment-Appboy.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 3E1CB38A67EF2A5AD3E448E7 /* Pods_Segment_Appboy_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 589BD37A4C260FD9A3C992C7 /* Pods_Segment_Appboy_Example.framework */; }; 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; @@ -23,7 +24,6 @@ 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; D3C0897B71D57C614E791C33 /* Pods_Segment_Appboy_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F373C65B14EBD0A693B5E1B9 /* Pods_Segment_Appboy_Tests.framework */; }; E34AFDEF1C0E7B3B0069EFC5 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = E34AFDEE1C0E7B3B0069EFC5 /* LaunchScreen.xib */; }; - EE2F29D98DEAD57250510643 /* Pods_Segment_Appboy_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 589BD37A4C260FD9A3C992C7 /* Pods_Segment_Appboy_Example.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -75,7 +75,7 @@ 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, - EE2F29D98DEAD57250510643 /* Pods_Segment_Appboy_Example.framework in Frameworks */, + 3E1CB38A67EF2A5AD3E448E7 /* Pods_Segment_Appboy_Example.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Example/Segment-Appboy/SEGViewController.m b/Example/Segment-Appboy/SEGViewController.m index 27a891d..6706d7c 100644 --- a/Example/Segment-Appboy/SEGViewController.m +++ b/Example/Segment-Appboy/SEGViewController.m @@ -19,11 +19,18 @@ - (void)didReceiveMemoryWarning } - (IBAction)identifyButtonPress:(id)sender { + NSInteger integerAttribute = 200; + float floatAttribute = 12.3f; + int intAttribute = 18; + short shortAttribute = (short)2; [[SEGAnalytics sharedAnalytics] identify:@"appboySegementTestUseriOS" traits:@{ @"email": @"hello@appboy.com", @"bool" : @(YES), @"double" : @(3.14159), - @"integer": @(31), + @"intAttribute": @(intAttribute), + @"integerAttribute" : @(integerAttribute), + @"floatAttribute" : @(floatAttribute), + @"shortAttribute" : @(shortAttribute), @"gender" : @"female", @"birthday" : [NSDate dateWithTimeIntervalSince1970:564559200], @"firstName" : @"Appboy", diff --git a/Pod/Classes/SEGAppboyIntegration.m b/Pod/Classes/SEGAppboyIntegration.m index b7e8b51..ef524ba 100644 --- a/Pod/Classes/SEGAppboyIntegration.m +++ b/Pod/Classes/SEGAppboyIntegration.m @@ -136,10 +136,13 @@ - (void)identify:(SEGIdentifyPayload *)payload if (strcmp([traitValue objCType], [@(YES) objCType]) == 0) { [[Appboy sharedInstance].user setCustomAttributeWithKey:key andBOOLValue:[(NSNumber *)traitValue boolValue]]; SEGLog(@"[[Appboy sharedInstance].user setCustomAttributeWithKey: andBOOLValue:]"); - } else if (strcmp([traitValue objCType], @encode(int)) == 0) { + } else if (strcmp([traitValue objCType], @encode(short)) == 0 || + strcmp([traitValue objCType], @encode(int)) == 0 || + strcmp([traitValue objCType], @encode(long)) == 0) { [[Appboy sharedInstance].user setCustomAttributeWithKey:key andIntegerValue:[(NSNumber *)traitValue integerValue]]; SEGLog(@"[[Appboy sharedInstance].user setCustomAttributeWithKey: andIntegerValue:]"); - } else if (strcmp([traitValue objCType], @encode(double)) == 0) { + } else if (strcmp([traitValue objCType], @encode(float)) == 0 || + strcmp([traitValue objCType], @encode(double)) == 0) { [[Appboy sharedInstance].user setCustomAttributeWithKey:key andDoubleValue:[(NSNumber *)traitValue doubleValue]]; SEGLog(@"[[Appboy sharedInstance].user setCustomAttributeWithKey: andDoubleValue:]"); } else { diff --git a/Pod/Classes/SEGAppboyIntegrationFactory.h b/Pod/Classes/SEGAppboyIntegrationFactory.h index 29fe044..c289205 100644 --- a/Pod/Classes/SEGAppboyIntegrationFactory.h +++ b/Pod/Classes/SEGAppboyIntegrationFactory.h @@ -3,7 +3,7 @@ @interface SEGAppboyIntegrationFactory : NSObject -+ (id)instance; ++ (instancetype)instance; - (void)saveLaunchOptions:(NSDictionary *)launchOptions; - (void)saveRemoteNotification:(NSDictionary *)userInfo; diff --git a/Pod/Classes/SEGAppboyIntegrationFactory.m b/Pod/Classes/SEGAppboyIntegrationFactory.m index 6f35727..ce497c0 100644 --- a/Pod/Classes/SEGAppboyIntegrationFactory.m +++ b/Pod/Classes/SEGAppboyIntegrationFactory.m @@ -7,7 +7,7 @@ @interface SEGAppboyIntegrationFactory () @implementation SEGAppboyIntegrationFactory -+ (id)instance ++ (instancetype)instance { static dispatch_once_t once; static SEGAppboyIntegrationFactory *sharedInstance; diff --git a/Segment-Appboy.podspec b/Segment-Appboy.podspec index f6b70cc..409da03 100644 --- a/Segment-Appboy.podspec +++ b/Segment-Appboy.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Segment-Appboy" - s.version = "1.0.1" + s.version = "1.0.2" s.summary = "Appboy Integration for Segment's analytics-ios library." s.description = <<-DESC