Skip to content

Commit 1fa7a92

Browse files
author
Diego Serrano
committed
Add support for custom first question
1 parent 27115dc commit 1fa7a92

File tree

7 files changed

+23
-5
lines changed

7 files changed

+23
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.25.0 (2023-02-21)
2+
3+
### Changes:
4+
5+
- Add support for custom first question
6+
17
## 0.24.1 (2023-02-16)
28

39
### Changes:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The easiest way to get Wootric into your iOS project is to use [CocoaPods](http:
2828

2929
2. Create a file in your Xcode project called Podfile and add the following line:
3030
```ruby
31-
pod "WootricSDK", "~> 0.24.1"
31+
pod "WootricSDK", "~> 0.25.0"
3232
```
3333

3434
3. In your Xcode project directory run the following command:

WootricSDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'WootricSDK'
3-
s.version = '0.24.1'
3+
s.version = '0.25.0'
44
s.license = 'MIT'
55
s.summary = 'Wootric SDK for displaying survey for end user.'
66
s.homepage = 'https://github.com/Wootric/WootricSDK-iOS'

WootricSDK/WootricSDK.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@
972972
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
973973
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
974974
MACH_O_TYPE = mh_dylib;
975-
MARKETING_VERSION = 0.24.1;
975+
MARKETING_VERSION = 0.25.0;
976976
MODULEMAP_FILE = "";
977977
PRODUCT_BUNDLE_IDENTIFIER = "com.wootric.$(PRODUCT_NAME:rfc1034identifier)";
978978
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -999,7 +999,7 @@
999999
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
10001000
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
10011001
MACH_O_TYPE = mh_dylib;
1002-
MARKETING_VERSION = 0.24.1;
1002+
MARKETING_VERSION = 0.25.0;
10031003
MODULEMAP_FILE = "";
10041004
PRODUCT_BUNDLE_IDENTIFIER = "com.wootric.$(PRODUCT_NAME:rfc1034identifier)";
10051005
PRODUCT_NAME = "$(TARGET_NAME)";

WootricSDK/WootricSDK/UIItems.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ + (UILabel *)questionLabelWithSettings:(WTRSettings *)settings font:(UIFont *)fo
136136
tempLabel.numberOfLines = 0;
137137
tempLabel.lineBreakMode = NSLineBreakByWordWrapping;
138138
tempLabel.font = font;
139-
tempLabel.text = [settings questionText];
139+
if (settings.customFirstQuestionEnabled && settings.customFirstQuestion != nil) {
140+
tempLabel.text = [settings customFirstQuestion];
141+
} else {
142+
tempLabel.text = [settings questionText];
143+
}
140144
[tempLabel setTranslatesAutoresizingMaskIntoConstraints:NO];
141145

142146
return tempLabel;

WootricSDK/WootricSDK/WTRSettings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
@property (nonatomic, strong) NSString *customQuestion;
4242
@property (nonatomic, strong) NSString *externalId;
4343
@property (nonatomic, strong) NSString *phoneNumber;
44+
@property (nonatomic, strong) NSString *customFirstQuestion;
4445
@property (nonatomic, strong) NSNumber *registeredPercentage;
4546
@property (nonatomic, strong) NSNumber *visitorPercentage;
4647
@property (nonatomic, strong) NSNumber *resurveyThrottle;
@@ -60,6 +61,7 @@
6061
@property (nonatomic, assign) BOOL skipFeedbackScreenForPromoter;
6162
@property (nonatomic, assign) BOOL passScoreAndTextToURL;
6263
@property (nonatomic, assign) BOOL showPoweredBy;
64+
@property (nonatomic, assign) BOOL customFirstQuestionEnabled;
6365
@property (nonatomic, strong) UIColor *sendButtonBackgroundColor;
6466
@property (nonatomic, strong) UIColor *sliderColor;
6567
@property (nonatomic, strong) UIColor *socialSharingColor;

WootricSDK/WootricSDK/WTRSettings.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ - (instancetype)init {
6565
_scale = [self scoreRules][_surveyType][0];
6666
_showOptOut = NO;
6767
_showPoweredBy = YES;
68+
_customFirstQuestionEnabled = NO;
6869
}
6970

7071
return self;
@@ -89,6 +90,7 @@ - (void)parseDataFromSurveyServer:(NSDictionary *)surveyServerSettings {
8990
NSString *languageCodeFromServer = surveyServerSettings[@"settings"][@"language"];
9091
NSInteger delay = _timeDelay > -1 ? _timeDelay : [surveyServerSettings[@"settings"][@"time_delay"] integerValue];
9192
_showPoweredBy = [surveyServerSettings[@"settings"][@"powered_by"] boolValue];
93+
_customFirstQuestionEnabled = [surveyServerSettings[@"settings"][@"custom_first_question_enabled"] boolValue];
9294

9395
if (surveyTypeFromSurvey) {
9496
_surveyType = surveyTypeFromSurvey;
@@ -136,6 +138,10 @@ - (void)parseDataFromSurveyServer:(NSDictionary *)surveyServerSettings {
136138
if (languageCodeFromServer) {
137139
_languageCode = languageCodeFromServer;
138140
}
141+
142+
if (_customFirstQuestionEnabled && surveyServerSettings[@"settings"][@"custom_first_question"] != nil) {
143+
_customFirstQuestion = surveyServerSettings[@"settings"][@"custom_first_question"];
144+
}
139145
}
140146
}
141147

0 commit comments

Comments
 (0)