From 139d657809073a6c1b9fc88d9a4eb215a3453f55 Mon Sep 17 00:00:00 2001 From: Tim Kelly Date: Fri, 6 Jan 2017 12:01:47 -0600 Subject: [PATCH] Remove action parameter from Conversations FeedbackRequest. Bump BVSDK to 6.1.1 --- BVSDK.podspec | 2 +- BVSDK/Info.plist | 4 ++-- .../Obj-C/ConversationsExample/RootViewController.m | 1 - .../Swift/ConversationsExample/RootViewController.swift | 1 - Pod/BVCommon/BVCore.h | 4 ++-- .../Submission/Feedback/BVFeedbackSubmission.h | 3 +-- .../Submission/Feedback/BVFeedbackSubmission.m | 9 ++++----- .../SubmissionTests/FeedbackSubmissionTests.swift | 5 +---- 8 files changed, 11 insertions(+), 18 deletions(-) diff --git a/BVSDK.podspec b/BVSDK.podspec index 4ef4e60e..2cdaa2f6 100644 --- a/BVSDK.podspec +++ b/BVSDK.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.name = "BVSDK" - s.version = '6.1.0' + s.version = '6.1.1' s.homepage = 'https://developer.bazaarvoice.com' s.license = { :type => 'Commercial', :text => 'See https://developer.bazaarvoice.com/API_Terms_of_Use' } s.author = { 'Bazaarvoice' => 'support@bazaarvoice.com' } diff --git a/BVSDK/Info.plist b/BVSDK/Info.plist index a2582ead..44297cec 100644 --- a/BVSDK/Info.plist +++ b/BVSDK/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 6.1.0 + 6.1.1 CFBundleVersion - 6.1.0 + 6.1.1 LSApplicationCategoryType NSPrincipalClass diff --git a/Examples/Conversations/Obj-C/ConversationsExample/RootViewController.m b/Examples/Conversations/Obj-C/ConversationsExample/RootViewController.m index be1188c5..9b7064c2 100644 --- a/Examples/Conversations/Obj-C/ConversationsExample/RootViewController.m +++ b/Examples/Conversations/Obj-C/ConversationsExample/RootViewController.m @@ -92,7 +92,6 @@ - (IBAction)submitFeedbackTapped:(id)sender { feedback.userId = [NSString stringWithFormat:@"userId%d", arc4random()]; // add in a random user id for testing, avoids duplicate errors feedback.vote = BVFeedbackVotePositive; - feedback.action = BVSubmissionActionPreview; [feedback submit:^(BVFeedbackSubmissionResponse * _Nonnull response) { // success diff --git a/Examples/Conversations/Swift/ConversationsExample/RootViewController.swift b/Examples/Conversations/Swift/ConversationsExample/RootViewController.swift index 7118ea49..35cc2e47 100644 --- a/Examples/Conversations/Swift/ConversationsExample/RootViewController.swift +++ b/Examples/Conversations/Swift/ConversationsExample/RootViewController.swift @@ -119,7 +119,6 @@ class RootViewController: UIViewController { feedback.userId = "userId" + randomId feedback.vote = BVFeedbackVote.Positive - feedback.action = .Preview // don't submit for real feedback.submit({ (response) in // success diff --git a/Pod/BVCommon/BVCore.h b/Pod/BVCommon/BVCore.h index ea1bef2e..cae772d3 100644 --- a/Pod/BVCommon/BVCore.h +++ b/Pod/BVCommon/BVCore.h @@ -18,11 +18,11 @@ /// Provides the master version of the SDK. -#define BV_SDK_VERSION @"6.1.0" +#define BV_SDK_VERSION @"6.1.1" /// Conversation SDK Version #define SDK_HEADER_NAME @"X-UA-BV-SDK" -#define SDK_HEADER_VALUE @"IOS_SDK_V610" +#define SDK_HEADER_VALUE @"IOS_SDK_V611" /// Error domain for NSError results, when present. #define BVErrDomain @"com.bvsdk.bazaarvoice" diff --git a/Pod/BVConversations/Submission/Feedback/BVFeedbackSubmission.h b/Pod/BVConversations/Submission/Feedback/BVFeedbackSubmission.h index 3388085e..811ad2de 100644 --- a/Pod/BVConversations/Submission/Feedback/BVFeedbackSubmission.h +++ b/Pod/BVConversations/Submission/Feedback/BVFeedbackSubmission.h @@ -53,7 +53,6 @@ typedef void (^FeedbackSubmissionCompletion)(BVFeedbackSubmissionResponse* _Nonn @interface BVFeedbackSubmission : BVSubmission -@property BVSubmissionAction action; @property NSString* _Nonnull contentId; @property BVFeedbackContentType contentType; @property BVFeedbackType feedbackType; @@ -69,7 +68,7 @@ typedef void (^FeedbackSubmissionCompletion)(BVFeedbackSubmissionResponse* _Nonn -(nonnull instancetype) __unavailable init; /** - Submit feedback to the Bazaarvoice platform. If the `action` of this object is set to `BVSubmissionActionPreview` then the submission will NOT actually take place. + Submit feedback to the Bazaarvoice platform. A submission can fail for many reasons, and is dependent on your submission configuration. diff --git a/Pod/BVConversations/Submission/Feedback/BVFeedbackSubmission.m b/Pod/BVConversations/Submission/Feedback/BVFeedbackSubmission.m index 16652c12..6bd218d0 100644 --- a/Pod/BVConversations/Submission/Feedback/BVFeedbackSubmission.m +++ b/Pod/BVConversations/Submission/Feedback/BVFeedbackSubmission.m @@ -27,7 +27,7 @@ -(nonnull instancetype)initWithContentId:(nonnull NSString*)contentId -(void)submit:(nonnull FeedbackSubmissionCompletion)success failure:(nonnull ConversationsFailureHandler)failure{ - [self submitFeedback:self.action success:^(BVFeedbackSubmissionResponse * _Nonnull response) { + [self submitFeedbackWithCompletion:^(BVFeedbackSubmissionResponse * _Nonnull response) { success(response); } failure:^(NSArray * _Nonnull errors) { failure(errors); @@ -35,9 +35,9 @@ -(void)submit:(nonnull FeedbackSubmissionCompletion)success failure:(nonnull Con } --(void)submitFeedback:(BVSubmissionAction)BVSubmissionAction success:(nonnull FeedbackSubmissionCompletion)success failure:(nonnull ConversationsFailureHandler)failure { +-(void)submitFeedbackWithCompletion:(nonnull FeedbackSubmissionCompletion)success failure:(nonnull ConversationsFailureHandler)failure { - NSDictionary* parameters = [self createSubmissionParameters:BVSubmissionAction]; + NSDictionary* parameters = [self createSubmissionParameters]; NSData* postBody = [self transformToPostBody:parameters]; NSString* urlString = [NSString stringWithFormat:@"%@submitfeedback.json", [BVConversationsRequest commonEndpoint]]; @@ -118,12 +118,11 @@ -(NSData*)transformToPostBody:(NSDictionary*)dict { } --(nonnull NSDictionary*)createSubmissionParameters:(BVSubmissionAction)BVSubmissionAction { +-(nonnull NSDictionary*)createSubmissionParameters { NSMutableDictionary* parameters = [NSMutableDictionary dictionaryWithDictionary:@{ @"apiversion": @"5.4" }]; parameters[@"passkey"] = [BVSDKManager sharedManager].apiKeyConversations; - parameters[@"action"] = [BVSubmissionActionUtil toString:self.action]; parameters[@"userid"] = self.userId; parameters[@"contentId"] = self.contentId; diff --git a/Tests/Tests/ConversationsTests/SubmissionTests/FeedbackSubmissionTests.swift b/Tests/Tests/ConversationsTests/SubmissionTests/FeedbackSubmissionTests.swift index e511555d..41206a94 100644 --- a/Tests/Tests/ConversationsTests/SubmissionTests/FeedbackSubmissionTests.swift +++ b/Tests/Tests/ConversationsTests/SubmissionTests/FeedbackSubmissionTests.swift @@ -30,8 +30,7 @@ class FeedbackSubmissionTests: XCTestCase { feedback.userId = "userId" + randomId feedback.vote = .positive - feedback.action = .preview // don't submit for real - + feedback.submit({ (response) in // success // verify response object.... @@ -60,7 +59,6 @@ class FeedbackSubmissionTests: XCTestCase { let randomId = String(arc4random()) feedback.userId = "userId" + randomId - feedback.action = .preview feedback.reasonText = "Optional reason text in this field." feedback.submit({ (response) in @@ -91,7 +89,6 @@ class FeedbackSubmissionTests: XCTestCase { let randomId = String(arc4random()) feedback.userId = "userId" + randomId - feedback.action = .preview feedback.submit({ (response) in // success