Skip to content

Commit

Permalink
Release 8.13.3
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rahulbawane authored Mar 5, 2025
2 parents 74ddf1d + 4228a26 commit da0c886
Show file tree
Hide file tree
Showing 35 changed files with 387 additions and 204 deletions.
2 changes: 1 addition & 1 deletion BVSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Pod::Spec.new do |s|
s.name = "BVSDK"
s.version = '8.13.2'
s.version = '8.13.3'
s.homepage = 'https://developer.bazaarvoice.com/'
s.license = { :type => 'Commercial', :text => 'See https://developer.bazaarvoice.com/API_Terms_of_Use' }
s.author = { 'Bazaarvoice' => '[email protected]' }
Expand Down
12 changes: 10 additions & 2 deletions BVSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,8 @@
B78683D02D096C1900BBCE3F /* BVSummarisedFeaturesQueryTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B78683CF2D096C1900BBCE3F /* BVSummarisedFeaturesQueryTest.swift */; };
B78683D32D096FD900BBCE3F /* BVProductSentimentsErrorResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = B78683D22D096FD900BBCE3F /* BVProductSentimentsErrorResponse.h */; settings = {ATTRIBUTES = (Public, ); }; };
B78683D52D096FEE00BBCE3F /* BVProductSentimentsErrorResponse.m in Sources */ = {isa = PBXBuildFile; fileRef = B78683D42D096FEE00BBCE3F /* BVProductSentimentsErrorResponse.m */; };
B78F94682D548EA500D9ECC4 /* BVProductSentimentsError.m in Sources */ = {isa = PBXBuildFile; fileRef = B78F94672D548EA500D9ECC4 /* BVProductSentimentsError.m */; };
B78F94692D548EA900D9ECC4 /* BVProductSentimentsError.h in Headers */ = {isa = PBXBuildFile; fileRef = B78F94662D548E9600D9ECC4 /* BVProductSentimentsError.h */; };
B7B3B95C2BAAB48D00A2831B /* BVSubmittedVideo.m in Sources */ = {isa = PBXBuildFile; fileRef = B7B3B95B2BAAB48D00A2831B /* BVSubmittedVideo.m */; };
B7B3B95E2BAAB4B500A2831B /* BVVideoSubmission.h in Headers */ = {isa = PBXBuildFile; fileRef = B7E7C6A72BA2D70F006632CF /* BVVideoSubmission.h */; settings = {ATTRIBUTES = (Public, ); }; };
B7B3B95F2BAAB4B700A2831B /* BVSubmittedVideo.h in Headers */ = {isa = PBXBuildFile; fileRef = B7B3B95D2BAAB49F00A2831B /* BVSubmittedVideo.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -1450,6 +1452,8 @@
B78683CF2D096C1900BBCE3F /* BVSummarisedFeaturesQueryTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BVSummarisedFeaturesQueryTest.swift; sourceTree = "<group>"; };
B78683D22D096FD900BBCE3F /* BVProductSentimentsErrorResponse.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BVProductSentimentsErrorResponse.h; sourceTree = "<group>"; };
B78683D42D096FEE00BBCE3F /* BVProductSentimentsErrorResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BVProductSentimentsErrorResponse.m; sourceTree = "<group>"; };
B78F94662D548E9600D9ECC4 /* BVProductSentimentsError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BVProductSentimentsError.h; sourceTree = "<group>"; };
B78F94672D548EA500D9ECC4 /* BVProductSentimentsError.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BVProductSentimentsError.m; sourceTree = "<group>"; };
B7B3B95B2BAAB48D00A2831B /* BVSubmittedVideo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BVSubmittedVideo.m; sourceTree = "<group>"; };
B7B3B95D2BAAB49F00A2831B /* BVSubmittedVideo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BVSubmittedVideo.h; sourceTree = "<group>"; };
B7B3B9602BAAB62100A2831B /* BVVideoSubmissionResponse.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BVVideoSubmissionResponse.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2935,6 +2939,8 @@
B78683B92CEDE78D00BBCE3F /* NSError+BVProductSentimentsErrorCodeParser.m */,
B78683D22D096FD900BBCE3F /* BVProductSentimentsErrorResponse.h */,
B78683D42D096FEE00BBCE3F /* BVProductSentimentsErrorResponse.m */,
B78F94662D548E9600D9ECC4 /* BVProductSentimentsError.h */,
B78F94672D548EA500D9ECC4 /* BVProductSentimentsError.m */,
);
path = Errors;
sourceTree = "<group>";
Expand Down Expand Up @@ -3017,8 +3023,8 @@
B7C833522D2E79D30088B7C0 /* BVProductExpressionsResponse.m */,
);
path = ProductExpressions;
sourceTree = "<group>";
};
sourceTree = "<group>";
};
B7C8335C2D2FA9020088B7C0 /* ReviewSummarisation */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -3122,6 +3128,7 @@
87F2DD411DAD585E00FB43F3 /* BVRecommendedProduct.h in Headers */,
B58639BB214AFE0A00EFD763 /* BVSDKConfiguration.h in Headers */,
87F2DD051DAD585E00FB43F3 /* BVQuestionsCollectionView.h in Headers */,
B78F94692D548EA900D9ECC4 /* BVProductSentimentsError.h in Headers */,
87F2DC1E1DAD585E00FB43F3 /* BVPixel.h in Headers */,
87F2DC991DAD585E00FB43F3 /* BVReview.h in Headers */,
87F2DCCF1DAD585E00FB43F3 /* BVAnswerSubmissionResponse.h in Headers */,
Expand Down Expand Up @@ -3783,6 +3790,7 @@
B575C3871FBDFD6F000F890B /* BVUASSubmission.m in Sources */,
87E810E61ECCA0190032C753 /* BVCommentsSortOption.m in Sources */,
875411761E1F201E006C5C6E /* BVNotificationsAnalyticsHelper.m in Sources */,
B78F94682D548EA500D9ECC4 /* BVProductSentimentsError.m in Sources */,
87D425281E8EE39700147FDB /* BVViewedCGCEvent.m in Sources */,
87F2DD061DAD585E00FB43F3 /* BVQuestionsCollectionView.m in Sources */,
87F2DCE21DAD585E00FB43F3 /* BVPhotoSubmission.m in Sources */,
Expand Down
3 changes: 2 additions & 1 deletion BVSDK/BVAnalytics/BVPixelEvents/BVPixelTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ typedef NS_ENUM(NSInteger, BVPixelProductType) {
BVPixelProductTypeProductRecommendations,
BVPixelProductTypePIN,
BVPixelProductTypeLocation,
BVPixelProductTypeProgressiveSubmission
BVPixelProductTypeProgressiveSubmission,
BVPixelProductTypeProductSentiments
};

@interface BVPixelProductTypeUtil : NSObject
Expand Down
2 changes: 2 additions & 0 deletions BVSDK/BVAnalytics/BVPixelEvents/BVPixelTypes.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ + (NSString *)toString:(BVPixelProductType)productType {
return @"Curations";
case BVPixelProductTypeProgressiveSubmission:
return @"ProgressiveSubmission";
case BVPixelProductTypeProductSentiments:
return @"ProductSentiments";
default:
return @"UnknownProduct";
}
Expand Down
2 changes: 1 addition & 1 deletion BVSDK/BVCommon/BVSDKConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define BVSDKConstants_h

/// Provides the master version of the SDK.
#define BV_SDK_VERSION @"8.13.2"
#define BV_SDK_VERSION @"8.13.3"

/// Conversation SDK Version
#define SDK_HEADER_NAME @"X-UA-BV-SDK"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
- (nonnull NSString *)getPassKey;

- (nonnull NSError *)limitError:(NSInteger)limit;
- (nonnull NSError *)tooManyProductsError:
(nonnull NSArray<NSString *> *)productIds;

- (void)
loadContent:(nonnull BVProductSentimentsRequest *)request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

#import <Foundation/Foundation.h>
#import "BVProductSentimentsRequest.h"
//#import "BVDisplayErrorResponse.h"
#import "BVLogger+Private.h"
#import "BVNetworkingManager.h"
#import "BVSDKConfiguration.h"
#import "BVSDKManager+Private.h"
#import "BVStringKeyValuePair.h"
#import "BVProductSentimentsErrorResponse.h"

@interface BVProductSentimentsRequest ()
@property(strong, nonatomic)
Expand All @@ -28,22 +28,22 @@ - (instancetype)init {
- (nonnull NSMutableArray<BVStringKeyValuePair *> *)createParams {
NSMutableArray<BVStringKeyValuePair *> *params = [NSMutableArray array];

// [params
// addObject:[BVStringKeyValuePair pairWithKey:@"apiversion" value:@"5.4"]];
[params
addObject:[BVStringKeyValuePair pairWithKey:@"apiversion" value:@"5.4"]];
// [params addObject:[BVStringKeyValuePair pairWithKey:@"passkey"
// value:[self getPassKey]]];
// [params addObject:[BVStringKeyValuePair
// pairWithKey:@"_appId"
// value:[NSBundle mainBundle].bundleIdentifier]];
// [params
// addObject:[BVStringKeyValuePair
// pairWithKey:@"_appVersion"
// value:[BVDiagnosticHelpers releaseVersionNumber]]];
// [params addObject:[BVStringKeyValuePair
// pairWithKey:@"_buildNumber"
// value:[BVDiagnosticHelpers buildVersionNumber]]];
// [params addObject:[BVStringKeyValuePair pairWithKey:@"_bvIosSdkVersion"
// value:BV_SDK_VERSION]];
[params addObject:[BVStringKeyValuePair
pairWithKey:@"_appId"
value:[NSBundle mainBundle].bundleIdentifier]];
[params
addObject:[BVStringKeyValuePair
pairWithKey:@"_appVersion"
value:[BVDiagnosticHelpers releaseVersionNumber]]];
[params addObject:[BVStringKeyValuePair
pairWithKey:@"_buildNumber"
value:[BVDiagnosticHelpers buildVersionNumber]]];
[params addObject:[BVStringKeyValuePair pairWithKey:@"_bvIosSdkVersion"
value:BV_SDK_VERSION]];

if (_customQueryParameters) {
[params addObjectsFromArray:_customQueryParameters];
Expand Down Expand Up @@ -142,42 +142,33 @@ + (nonnull NSString *)commonEndpoint {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
NSInteger statusCode = [httpResponse statusCode];

if (statusCode == 200) {
@try {
NSError *err;
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:&err];
if (json) {

// BVDisplayErrorResponse *errorResponse =
// [[BVDisplayErrorResponse alloc] initWithApiResponse:json];
//
// BVLogVerbose(([NSString stringWithFormat:@"RESPONSE: %@ (%ld)", json,
// (long)statusCode]),
// BV_PRODUCT_CONVERSATIONS);
//
// if (errorResponse) {
// [self sendErrors:[errorResponse toNSErrors] failureCallback:failure];
// } else {
// // invoke success callback on main thread
dispatch_async(dispatch_get_main_queue(), ^{
completion(json);
});
// }
} else if (err) {
[self sendError:err failureCallback:failure];
} else {
NSError *parsingError =
[NSError errorWithDomain:BVErrDomain
code:BV_ERROR_PARSING_FAILED
userInfo:@{
NSLocalizedDescriptionKey :
@"An unknown parsing error occurred."
}];
[self sendError:parsingError failureCallback:failure];
}

NSError *err;
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:&err];

if (statusCode == 200 && json) {
dispatch_async(dispatch_get_main_queue(), ^{
completion(json);
});
} else if (statusCode) {
BVProductSentimentsErrorResponse *errorResponse =
[[BVProductSentimentsErrorResponse alloc] initWithApiResponse:json statusCode:[@(statusCode) stringValue]];
BVLogVerbose(([NSString stringWithFormat:@"RESPONSE: %@ (%ld)", json,
(long)statusCode]),
BV_PRODUCT_CONVERSATIONS);
[self sendErrors:[errorResponse toNSErrors] failureCallback:failure];
} else {
NSString *message = [NSString
stringWithFormat:@"HTTP response status code: %li with error: %@",
(long)statusCode, error.localizedDescription];
NSError *enhancedError =
[NSError errorWithDomain:BVErrDomain
code:BV_ERROR_NETWORK_FAILED
userInfo:@{NSLocalizedDescriptionKey : message}];
[self sendError:enhancedError failureCallback:failure];
}
} @catch (NSException *exception) {
NSError *err =
[NSError errorWithDomain:BVErrDomain
Expand All @@ -188,16 +179,6 @@ + (nonnull NSString *)commonEndpoint {
}];
[self sendError:err failureCallback:failure];
}
} else {
NSString *message = [NSString
stringWithFormat:@"HTTP response status code: %li with error: %@",
(long)statusCode, error.localizedDescription];
NSError *enhancedError =
[NSError errorWithDomain:BVErrDomain
code:BV_ERROR_NETWORK_FAILED
userInfo:@{NSLocalizedDescriptionKey : message}];
[self sendError:enhancedError failureCallback:failure];
}
}

- (nonnull NSError *)limitError:(NSInteger)limit {
Expand All @@ -210,17 +191,6 @@ - (nonnull NSError *)limitError:(NSInteger)limit {
userInfo:@{NSLocalizedDescriptionKey : message}];
}

- (nonnull NSError *)tooManyProductsError:
(nonnull NSArray<NSString *> *)productIds {
NSString *message = [NSString
stringWithFormat:
@"Too many productIds requested: %lu. Must be between 1 and 100.",
(unsigned long)[productIds count]];
return [NSError errorWithDomain:BVErrDomain
code:BV_ERROR_TOO_MANY_PRODUCTS
userInfo:@{NSLocalizedDescriptionKey : message}];
}

- (void)sendError:(nonnull NSError *)error
failureCallback:(ProductSentimentsFailureHandler)failure {
[self sendErrors:@[ error ] failureCallback:failure];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// BVProductSentimentsError.h
// BVSDK
//
// Copyright © 2025 Bazaarvoice. All rights reserved.
//

#ifndef BVProductSentimentsError_h
#define BVProductSentimentsError_h

#import <Foundation/Foundation.h>

#define BVKeyPSErrorDomainCode @(999)

extern NSString *__nonnull const BVKeyPSStatusCode;
extern NSString *__nonnull const BVKeyPSErrorCode;
extern NSString *__nonnull const BVKeyPSErrorMessage;

@interface BVProductSentimentsError : NSObject

@property(nonnull) NSString *message;
@property(nonnull) NSString *code;
@property(nonnull) NSString *status;

- (nonnull id)initWithApiResponse:(nonnull NSDictionary *)apiResponse
statusCode:(nonnull NSString *) statusCode;
- (nonnull NSError *)toNSError;

@end


#endif /* BVProductSentimentsError_h */
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// BVProductSentimentsError.m
// BVSDK
//
// Copyright © 2025 Bazaarvoice. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "BVProductSentimentsError.h"
#import "BVCommon.h"
#import "BVNullHelper.h"

NSString *__nonnull const BVKeyPSStatusCode = @"BVKeyPSStatusCode";
NSString *__nonnull const BVKeyPSErrorCode = @"BVKeyPSErrorCode";
NSString *__nonnull const BVKeyPSErrorMessage = @"BVKeyPSErrorMessage";

@implementation BVProductSentimentsError

- (nonnull id)initWithApiResponse:(nonnull NSDictionary *)apiResponse statusCode:(nonnull NSString *)statusCode {
if ((self = [super init])) {
self.status = statusCode;
self.code = @"N/A";
self.message = @"N/A";

SET_IF_NOT_NULL_WITH_ALTERNATE(self.code, apiResponse[@"code"], apiResponse[@"title"])
SET_IF_NOT_NULL_WITH_ALTERNATE(self.message, apiResponse[@"message"], apiResponse[@"detail"])
}
return self;
}

- (nonnull NSError *)toNSError {
NSString *description =
[NSString stringWithFormat:@"%@: %@\n%@", self.status, self.code, self.message];
return [NSError errorWithDomain:BVErrDomain
code:BVKeyPSErrorDomainCode.integerValue
userInfo:@{
NSLocalizedDescriptionKey : description,
BVKeyPSStatusCode : self.status,
BVKeyPSErrorCode : self.message,
BVKeyPSErrorMessage : self.code
}];
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@
*/
@interface BVProductSentimentsErrorResponse : NSObject

@property(nonnull) NSString *code;
@property(nonnull) NSString *type;
@property(nonnull) NSString *title;
@property(nonnull) NSString *detail;

- (nullable id)initWithApiResponse:(nonnull NSDictionary *)apiResponse;
- (nullable id)initWithApiResponse:(nonnull NSDictionary *)apiResponse
statusCode:(nonnull NSString *)statusCode;
- (nonnull NSArray<NSError *> *)toNSErrors;

@end
Expand Down
Loading

0 comments on commit da0c886

Please sign in to comment.