Skip to content

Commit e2ad5c7

Browse files
authored
Merge pull request #269 from apptentive/branch_5.2.10
Release 5.2.10
2 parents 1be5242 + 66392a2 commit e2ad5c7

13 files changed

+201
-43
lines changed

Apptentive/Apptentive.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -2405,7 +2405,7 @@
24052405
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
24062406
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
24072407
COPY_PHASE_STRIP = NO;
2408-
CURRENT_PROJECT_VERSION = 37;
2408+
CURRENT_PROJECT_VERSION = 38;
24092409
DEBUG_INFORMATION_FORMAT = dwarf;
24102410
ENABLE_STRICT_OBJC_MSGSEND = YES;
24112411
ENABLE_TESTABILITY = YES;
@@ -2463,7 +2463,7 @@
24632463
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
24642464
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
24652465
COPY_PHASE_STRIP = NO;
2466-
CURRENT_PROJECT_VERSION = 37;
2466+
CURRENT_PROJECT_VERSION = 38;
24672467
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
24682468
ENABLE_NS_ASSERTIONS = NO;
24692469
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -2495,7 +2495,7 @@
24952495
DEFINES_MODULE = YES;
24962496
DEVELOPMENT_TEAM = 86WML2UN43;
24972497
DYLIB_COMPATIBILITY_VERSION = 1;
2498-
DYLIB_CURRENT_VERSION = 37;
2498+
DYLIB_CURRENT_VERSION = 38;
24992499
DYLIB_INSTALL_NAME_BASE = "@rpath";
25002500
GCC_PREFIX_HEADER = "Apptentive/Misc/ApptentiveConnect-Prefix.pch";
25012501
GCC_PREPROCESSOR_DEFINITIONS = "APPTENTIVE_DEBUG=1";
@@ -2515,7 +2515,7 @@
25152515
DEFINES_MODULE = YES;
25162516
DEVELOPMENT_TEAM = 86WML2UN43;
25172517
DYLIB_COMPATIBILITY_VERSION = 1;
2518-
DYLIB_CURRENT_VERSION = 37;
2518+
DYLIB_CURRENT_VERSION = 38;
25192519
DYLIB_INSTALL_NAME_BASE = "@rpath";
25202520
GCC_PREFIX_HEADER = "Apptentive/Misc/ApptentiveConnect-Prefix.pch";
25212521
INFOPLIST_FILE = Apptentive/Info.plist;

Apptentive/Apptentive/Apptentive.h

+18-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ FOUNDATION_EXPORT double ApptentiveVersionNumber;
2020
FOUNDATION_EXPORT const unsigned char ApptentiveVersionString[];
2121

2222
/** The version number of the Apptentive SDK. */
23-
#define kApptentiveVersionString @"5.2.9"
23+
#define kApptentiveVersionString @"5.2.10"
2424

2525
/** The version number of the Apptentive API platform. */
2626
#define kApptentiveAPIVersionString @"9"
@@ -84,7 +84,7 @@ extern NSNotificationName const ApptentiveSurveySentNotification;
8484
extern NSNotificationName const ApptentiveMessageSentNotification;
8585

8686
/** Notification user info key whose value indicates whether the message was sent by the user or using a sendAttachment method. */
87-
extern NSString * const ApptentiveSentByUserKey;
87+
extern NSString *const ApptentiveSentByUserKey;
8888

8989
/** Error domain for the Apptentive SDK */
9090
extern NSString *const ApptentiveErrorDomain;
@@ -127,6 +127,16 @@ typedef NS_ENUM(NSUInteger, ApptentiveLogLevel) {
127127
ApptentiveLogLevelVerbose = 6
128128
};
129129

130+
@interface TermsAndConditions : NSObject<NSCopying>
131+
132+
@property (nullable, strong, nonatomic, readonly) NSString *bodyText;
133+
@property (nullable, strong, nonatomic, readonly) NSString *linkText;
134+
@property (nullable, strong, nonatomic, readonly) NSURL *linkURL;
135+
136+
- (instancetype)initWithBodyText:(nullable NSString *)bodyText linkText:(nullable NSString *)linkText linkURL:(nullable NSURL *)linkURL;
137+
138+
@end
139+
130140
/**
131141
An `ApptentiveConfiguration` instance is used to pass configuration
132142
parameters into the `-registerWithConfiguration:` method.
@@ -164,6 +174,9 @@ typedef NS_ENUM(NSUInteger, ApptentiveLogLevel) {
164174
/** If set, shows a button in Surveys and Message Center that presents information about Apptentive including a link to our privacy policy. */
165175
@property (assign, nonatomic) BOOL showInfoButton;
166176

177+
/** If set, shows a valid combination of terms & conditions and/or a link with an optional text mask, below the submit button in Surveys. */
178+
@property (copy, nonatomic, nullable) TermsAndConditions* surveyTermsAndConditions;
179+
167180
/**
168181
Returns an instance of the `ApptentiveConfiguration` class
169182
initialized with the specified parameters.
@@ -246,6 +259,9 @@ typedef NS_ENUM(NSUInteger, ApptentiveLogLevel) {
246259

247260
@property (readonly, nonatomic) BOOL showInfoButton;
248261

262+
@property (copy, nonatomic, nullable, readonly) TermsAndConditions* surveyTermsAndConditions;
263+
264+
249265
/** An object conforming to the `ApptentiveDelegate` protocol.
250266
If a `nil` value is passed for the view controller into methods such as `-engage:fromViewController`,
251267
the SDK will request a view controller from the delegate from which to present an interaction.

Apptentive/Apptentive/Apptentive.m

+24-11
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,27 @@
5555
static Apptentive *_sharedInstance;
5656
static Apptentive *_nullInstance;
5757

58+
@implementation TermsAndConditions
59+
60+
- (instancetype)initWithBodyText:(nullable NSString *)bodyText linkText:(nullable NSString *)linkText linkURL:(nullable NSURL *)linkURL {
61+
62+
self = [super init];
63+
64+
if (self) {
65+
_bodyText = bodyText;
66+
_linkText = linkText;
67+
_linkURL = linkURL;
68+
}
69+
70+
return self;
71+
}
72+
73+
- (id)copyWithZone:(nullable NSZone *)zone {
74+
return [[[self class] alloc] initWithBodyText: [self.bodyText copy] linkText: [self.linkText copy] linkURL: [self.linkURL copy]];
75+
}
76+
77+
@end
78+
5879

5980
@implementation ApptentiveConfiguration
6081

@@ -145,7 +166,9 @@ - (id)initWithConfiguration:(ApptentiveConfiguration *)configuration {
145166
_appID = configuration.appID;
146167

147168
_showInfoButton = configuration.showInfoButton;
148-
169+
170+
_surveyTermsAndConditions = configuration.surveyTermsAndConditions;
171+
149172
setShouldSanitizeApptentiveLogMessages(configuration.shouldSanitizeLogMessages);
150173

151174
_backend = [[ApptentiveBackend alloc] initWithApptentiveKey:_apptentiveKey
@@ -1074,16 +1097,6 @@ @implementation ApptentiveNavigationController
10741097

10751098
// Container to allow customization of Apptentive UI using UIAppearance
10761099

1077-
- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
1078-
self = [super initWithCoder:aDecoder];
1079-
if (self) {
1080-
if (!([UINavigationBar appearance].barTintColor || [UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[ApptentiveNavigationController class]]].barTintColor)) {
1081-
[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[ApptentiveNavigationController class]]].barTintColor = [UIColor whiteColor];
1082-
}
1083-
}
1084-
return self;
1085-
}
1086-
10871100
- (void)presentAnimated:(BOOL)animated completion:(void (^__nullable)(void))completion {
10881101
self.apptentiveAlertWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
10891102
self.apptentiveAlertWindow.rootViewController = [[UIViewController alloc] init];

0 commit comments

Comments
 (0)