diff --git a/README.md b/README.md index 2f1a26a..ef5d008 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ App.net SDK in Objective-C Version ------- -0.63 +0.63.1 Platforms --------- diff --git a/Snapper.podspec b/Snapper.podspec index c8c71e5..a8b8c7c 100644 --- a/Snapper.podspec +++ b/Snapper.podspec @@ -1,13 +1,13 @@ Pod::Spec.new do |s| s.name = "Snapper" - s.version = "0.63" + s.version = "0.63.1" s.summary = "An App.net client library for iOS and Mac." s.homepage = "https://github.com/exsortis/Snapper" s.license = 'MIT' s.author = { "Paul Schifferer" => "paul@schifferers.net" } - s.source = { :git => "https://github.com/exsortis/Snapper.git", :tag => "0.63" } + s.source = { :git => "https://github.com/exsortis/Snapper.git", :tag => "0.63.1" } s.source_files = 'Snapper', 'Snapper/**/*.{h,m}' s.framework = 'Foundation' diff --git a/Snapper.xcworkspace/xcuserdata/pauly.xcuserdatad/UserInterfaceState.xcuserstate b/Snapper.xcworkspace/xcuserdata/pauly.xcuserdatad/UserInterfaceState.xcuserstate index 415bbc9..71df1cd 100644 Binary files a/Snapper.xcworkspace/xcuserdata/pauly.xcuserdatad/UserInterfaceState.xcuserstate and b/Snapper.xcworkspace/xcuserdata/pauly.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Snapper/Source/Shared/SNPBaseUserTokenOperation.m b/Snapper/Source/Shared/SNPBaseUserTokenOperation.m index 026f914..7f79716 100755 --- a/Snapper/Source/Shared/SNPBaseUserTokenOperation.m +++ b/Snapper/Source/Shared/SNPBaseUserTokenOperation.m @@ -105,6 +105,10 @@ - (void)main { if([value isKindOfClass:[NSNumber class]]) { [queryParams appendFormat:@"%@=%@", [key encodedURLParameterString], value]; } + else if([value isKindOfClass:[NSArray class]]) { + NSString* paramValue = [value componentsJoinedByString:@","]; + [queryParams appendFormat:@"%@=%@", [key encodedURLParameterString], [paramValue encodedURLParameterString]]; + } else { [queryParams appendFormat:@"%@=%@", [key encodedURLParameterString], [value encodedURLParameterString]]; } diff --git a/Snapper/Source/Shared/SNPInteraction.h b/Snapper/Source/Shared/SNPInteraction.h index 74fb69b..ad6cb70 100644 --- a/Snapper/Source/Shared/SNPInteraction.h +++ b/Snapper/Source/Shared/SNPInteraction.h @@ -27,5 +27,6 @@ typedef NS_ENUM(NSInteger, SNPInteractionAction) { @property (nonatomic, copy) NSArray* objects; @property (nonatomic, copy) NSArray* users; @property (nonatomic, copy) NSDate* eventDate; +@property (nonatomic, assign) NSInteger paginationId; @end diff --git a/Snapper/Source/Shared/SNPInteraction.m b/Snapper/Source/Shared/SNPInteraction.m index 76a622d..3cf72e5 100644 --- a/Snapper/Source/Shared/SNPInteraction.m +++ b/Snapper/Source/Shared/SNPInteraction.m @@ -27,9 +27,22 @@ + (NSDateFormatter*)dateFormatter { + (NSDictionary *)JSONKeyPathsByPropertyKey { return @{ @"eventDate": @"event_date", + @"paginationId": @"pagination_id", }; } ++ (NSValueTransformer*)paginationIdJSONTransformer { + return [MTLValueTransformer reversibleTransformerWithForwardBlock: + ^(NSString *strId) { + NSNumberFormatter* formatter = [NSNumberFormatter new]; + return @([[formatter numberFromString:strId] longLongValue]); + } + reverseBlock: + ^(NSNumber* intNum) { + return [NSString stringWithFormat:@"%lld", [intNum longLongValue]]; + }]; +} + + (NSValueTransformer*)actionJSONTransformer { NSDictionary* actionTypes = @{ @"follow": @(SNPInteractionActionFollow), diff --git a/Snapper/Source/Shared/SNPListInteractionsOperation.h b/Snapper/Source/Shared/SNPListInteractionsOperation.h index c267dee..5263e7d 100644 --- a/Snapper/Source/Shared/SNPListInteractionsOperation.h +++ b/Snapper/Source/Shared/SNPListInteractionsOperation.h @@ -11,4 +11,7 @@ @interface SNPListInteractionsOperation : SNPBaseUserTokenOperation +// -- Properties -- +@property (nonatomic, copy) NSArray* actions; + @end diff --git a/Snapper/Source/Shared/SNPListInteractionsOperation.m b/Snapper/Source/Shared/SNPListInteractionsOperation.m index 119fe37..71b6e40 100644 --- a/Snapper/Source/Shared/SNPListInteractionsOperation.m +++ b/Snapper/Source/Shared/SNPListInteractionsOperation.m @@ -22,6 +22,12 @@ @implementation SNPListInteractionsOperation - (void)main { self.endpoint = [[SNPAPIUtils sharedAPIUtils] getInteractionsEndpointURL]; + if([_actions count] > 0) { + NSMutableDictionary* params = [self.parameters mutableCopy]; + params[@"interaction_actions"] = _actions; + + self.parameters = [params copy]; + } self.serializationBlock = ^id(NSArray* responseData, NSError** error) { NSMutableArray* interactions = [NSMutableArray new];