Skip to content

Commit

Permalink
Remove action parameter from Conversations FeedbackRequest.
Browse files Browse the repository at this point in the history
Bump BVSDK to 6.1.1
  • Loading branch information
Tim Kelly committed Jan 6, 2017
1 parent 8087039 commit 139d657
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 18 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 = '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' => '[email protected]' }
Expand Down
4 changes: 2 additions & 2 deletions BVSDK/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>6.1.0</string>
<string>6.1.1</string>
<key>CFBundleVersion</key>
<string>6.1.0</string>
<string>6.1.1</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>NSPrincipalClass</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Pod/BVCommon/BVCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ -(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<NSError *> * _Nonnull errors) {
failure(errors);
}];

}

-(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]];
Expand Down Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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....
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -91,7 +89,6 @@ class FeedbackSubmissionTests: XCTestCase {
let randomId = String(arc4random())

feedback.userId = "userId" + randomId
feedback.action = .preview

feedback.submit({ (response) in
// success
Expand Down

0 comments on commit 139d657

Please sign in to comment.