Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 5.2.10 #269

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Apptentive/Apptentive.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2405,7 +2405,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 37;
CURRENT_PROJECT_VERSION = 38;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -2463,7 +2463,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 37;
CURRENT_PROJECT_VERSION = 38;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -2495,7 +2495,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 86WML2UN43;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 37;
DYLIB_CURRENT_VERSION = 38;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_PREFIX_HEADER = "Apptentive/Misc/ApptentiveConnect-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "APPTENTIVE_DEBUG=1";
Expand All @@ -2515,7 +2515,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 86WML2UN43;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 37;
DYLIB_CURRENT_VERSION = 38;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_PREFIX_HEADER = "Apptentive/Misc/ApptentiveConnect-Prefix.pch";
INFOPLIST_FILE = Apptentive/Info.plist;
Expand Down
20 changes: 18 additions & 2 deletions Apptentive/Apptentive/Apptentive.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FOUNDATION_EXPORT double ApptentiveVersionNumber;
FOUNDATION_EXPORT const unsigned char ApptentiveVersionString[];

/** The version number of the Apptentive SDK. */
#define kApptentiveVersionString @"5.2.9"
#define kApptentiveVersionString @"5.2.10"

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

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

/** Error domain for the Apptentive SDK */
extern NSString *const ApptentiveErrorDomain;
Expand Down Expand Up @@ -127,6 +127,16 @@ typedef NS_ENUM(NSUInteger, ApptentiveLogLevel) {
ApptentiveLogLevelVerbose = 6
};

@interface TermsAndConditions : NSObject<NSCopying>

@property (nullable, strong, nonatomic, readonly) NSString *bodyText;
@property (nullable, strong, nonatomic, readonly) NSString *linkText;
@property (nullable, strong, nonatomic, readonly) NSURL *linkURL;

- (instancetype)initWithBodyText:(nullable NSString *)bodyText linkText:(nullable NSString *)linkText linkURL:(nullable NSURL *)linkURL;

@end

/**
An `ApptentiveConfiguration` instance is used to pass configuration
parameters into the `-registerWithConfiguration:` method.
Expand Down Expand Up @@ -164,6 +174,9 @@ typedef NS_ENUM(NSUInteger, ApptentiveLogLevel) {
/** If set, shows a button in Surveys and Message Center that presents information about Apptentive including a link to our privacy policy. */
@property (assign, nonatomic) BOOL showInfoButton;

/** If set, shows a valid combination of terms & conditions and/or a link with an optional text mask, below the submit button in Surveys. */
@property (copy, nonatomic, nullable) TermsAndConditions* surveyTermsAndConditions;

/**
Returns an instance of the `ApptentiveConfiguration` class
initialized with the specified parameters.
Expand Down Expand Up @@ -246,6 +259,9 @@ typedef NS_ENUM(NSUInteger, ApptentiveLogLevel) {

@property (readonly, nonatomic) BOOL showInfoButton;

@property (copy, nonatomic, nullable, readonly) TermsAndConditions* surveyTermsAndConditions;


/** An object conforming to the `ApptentiveDelegate` protocol.
If a `nil` value is passed for the view controller into methods such as `-engage:fromViewController`,
the SDK will request a view controller from the delegate from which to present an interaction.
Expand Down
35 changes: 24 additions & 11 deletions Apptentive/Apptentive/Apptentive.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,27 @@
static Apptentive *_sharedInstance;
static Apptentive *_nullInstance;

@implementation TermsAndConditions

- (instancetype)initWithBodyText:(nullable NSString *)bodyText linkText:(nullable NSString *)linkText linkURL:(nullable NSURL *)linkURL {

self = [super init];

if (self) {
_bodyText = bodyText;
_linkText = linkText;
_linkURL = linkURL;
}

return self;
}

- (id)copyWithZone:(nullable NSZone *)zone {
return [[[self class] alloc] initWithBodyText: [self.bodyText copy] linkText: [self.linkText copy] linkURL: [self.linkURL copy]];
}

@end


@implementation ApptentiveConfiguration

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

_showInfoButton = configuration.showInfoButton;


_surveyTermsAndConditions = configuration.surveyTermsAndConditions;

setShouldSanitizeApptentiveLogMessages(configuration.shouldSanitizeLogMessages);

_backend = [[ApptentiveBackend alloc] initWithApptentiveKey:_apptentiveKey
Expand Down Expand Up @@ -1074,16 +1097,6 @@ @implementation ApptentiveNavigationController

// Container to allow customization of Apptentive UI using UIAppearance

- (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
twinklesharma1311 marked this conversation as resolved.
Show resolved Hide resolved
self = [super initWithCoder:aDecoder];
if (self) {
if (!([UINavigationBar appearance].barTintColor || [UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[ApptentiveNavigationController class]]].barTintColor)) {
[UINavigationBar appearanceWhenContainedInInstancesOfClasses:@[[ApptentiveNavigationController class]]].barTintColor = [UIColor whiteColor];
}
}
return self;
}

- (void)presentAnimated:(BOOL)animated completion:(void (^__nullable)(void))completion {
self.apptentiveAlertWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.apptentiveAlertWindow.rootViewController = [[UIViewController alloc] init];
Expand Down
Loading