Skip to content

Commit

Permalink
Merge pull request #248 from apptentive/branch_5.2.8
Browse files Browse the repository at this point in the history
Release 5.2.8
  • Loading branch information
frankus authored Nov 18, 2019
2 parents df75e96 + 785ad57 commit bff5c14
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 23 deletions.
8 changes: 4 additions & 4 deletions Apptentive/Apptentive.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2371,7 +2371,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 27;
CURRENT_PROJECT_VERSION = 28;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -2429,7 +2429,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 27;
CURRENT_PROJECT_VERSION = 28;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -2461,7 +2461,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 86WML2UN43;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 27;
DYLIB_CURRENT_VERSION = 28;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_PREFIX_HEADER = "Apptentive/Misc/ApptentiveConnect-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "APPTENTIVE_DEBUG=1";
Expand All @@ -2483,7 +2483,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 86WML2UN43;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 27;
DYLIB_CURRENT_VERSION = 28;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_PREFIX_HEADER = "Apptentive/Misc/ApptentiveConnect-Prefix.pch";
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
Expand Down
7 changes: 6 additions & 1 deletion 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.7"
#define kApptentiveVersionString @"5.2.8"

/** The version number of the Apptentive API platform. */
#define kApptentiveAPIVersionString @"9"
Expand Down Expand Up @@ -161,6 +161,9 @@ typedef NS_ENUM(NSUInteger, ApptentiveLogLevel) {
/** The iTunes store app ID of the app (used for Apptentive rating prompt). */
@property (copy, nonatomic, nullable) NSString *appID;

/** 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;

/**
Returns an instance of the `ApptentiveConfiguration` class
initialized with the specified parameters.
Expand Down Expand Up @@ -241,6 +244,8 @@ typedef NS_ENUM(NSUInteger, ApptentiveLogLevel) {
*/
@property (copy, nonatomic, nullable) NSString *appID;

@property (readonly, nonatomic) BOOL showInfoButton;

/** 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
3 changes: 3 additions & 0 deletions Apptentive/Apptentive/Apptentive.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ - (nullable instancetype)initWithApptentiveKey:(NSString *)apptentiveKey apptent
_baseURL = [NSURL URLWithString:@"https://api.apptentive.com/"];
_logLevel = ApptentiveLogLevelInfo;
_shouldSanitizeLogMessages = YES;
_showInfoButton = YES;
}
return self;
}
Expand Down Expand Up @@ -143,6 +144,8 @@ - (id)initWithConfiguration:(ApptentiveConfiguration *)configuration {
_baseURL = configuration.baseURL;
_appID = configuration.appID;

_showInfoButton = configuration.showInfoButton;

setShouldSanitizeApptentiveLogMessages(configuration.shouldSanitizeLogMessages);

_backend = [[ApptentiveBackend alloc] initWithApptentiveKey:_apptentiveKey
Expand Down
10 changes: 6 additions & 4 deletions Apptentive/Apptentive/Apptentive.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14865.1" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14819.2"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -1653,8 +1653,8 @@ Lines</string>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="eQS-jv-07Q" firstAttribute="trailing" secondItem="QJU-jb-fK0" secondAttribute="trailingMargin" constant="50" id="3M8-7U-DAv"/>
<constraint firstAttribute="trailingMargin" secondItem="eQS-jv-07Q" secondAttribute="trailing" id="5o0-nM-4r0"/>
<constraint firstItem="eQS-jv-07Q" firstAttribute="leading" secondItem="QJU-jb-fK0" secondAttribute="trailing" constant="8" id="eko-8l-aOf"/>
<constraint firstAttribute="trailingMargin" secondItem="QJU-jb-fK0" secondAttribute="trailing" priority="760" constant="3" id="WFh-nD-Kvx"/>
<constraint firstAttribute="trailing" secondItem="kjO-RC-C9t" secondAttribute="trailing" id="7ki-29-dG1"/>
<constraint firstItem="kjO-RC-C9t" firstAttribute="top" relation="greaterThanOrEqual" secondItem="eQS-jv-07Q" secondAttribute="bottom" constant="24" id="FhP-NR-GO3"/>
<constraint firstAttribute="trailing" secondItem="hym-vX-x0x" secondAttribute="trailing" id="O7u-UU-rCY"/>
Expand All @@ -1667,13 +1667,15 @@ Lines</string>
<constraint firstAttribute="bottom" secondItem="QJU-jb-fK0" secondAttribute="bottom" constant="26" id="inw-Yq-JwN"/>
<constraint firstItem="QJU-jb-fK0" firstAttribute="top" secondItem="5MM-w9-NsG" secondAttribute="top" constant="19" id="j86-Xc-x2p"/>
<constraint firstAttribute="bottom" secondItem="hym-vX-x0x" secondAttribute="bottom" id="o7f-uU-vfB"/>
<constraint firstAttribute="trailingMargin" secondItem="eQS-jv-07Q" secondAttribute="trailing" constant="17" id="vZy-Ar-xGY"/>
</constraints>
<viewLayoutGuide key="safeArea" id="H9x-X5-ni1"/>
<connections>
<outlet property="borderView" destination="kjO-RC-C9t" id="gjK-IH-cQv"/>
<outlet property="borderViewHeight" destination="BYb-xi-ZnV" id="RTk-wS-BmV"/>
<outlet property="greetingLabel" destination="QJU-jb-fK0" id="xYM-nv-FYb"/>
<outlet property="infoButton" destination="eQS-jv-07Q" id="Wss-bq-skU"/>
<outlet property="infoButtonSpacer" destination="eko-8l-aOf" id="eYL-k1-CtM"/>
</connections>
</view>
<view contentMode="scaleToFill" id="bBK-pb-4Z7">
Expand Down
2 changes: 1 addition & 1 deletion Apptentive/Apptentive/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.2.7</string>
<string>5.2.8</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ typedef NS_ENUM(NSInteger, ATMessageCenterMessageStatus) {
@property (readonly, nonatomic) id<ApptentiveStyle> styleSheet;

@property (readonly, nonatomic) NSString *title;
@property (readonly, nonatomic) NSString *branding;

@property (readonly, nonatomic) NSString *composerTitle;
@property (readonly, nonatomic) NSString *composerPlaceholderText;
Expand Down Expand Up @@ -83,6 +82,8 @@ typedef NS_ENUM(NSInteger, ATMessageCenterMessageStatus) {
@property (readonly, nonatomic) NSString *profileEditSkipButtonTitle;
@property (readonly, nonatomic) NSString *profileEditSaveButtonTitle;

@property (readonly, nonatomic) BOOL showInfoButton;

@property (readonly, nonatomic) BOOL networkIsReachable;

@property (assign, nonatomic) BOOL didSkipProfile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ - (NSString *)title {
return self.interaction.configuration[@"title"];
}

- (NSString *)branding {
return self.interaction.configuration[@"branding"];
}

#pragma mark - Composer

- (NSString *)composerTitle {
Expand Down Expand Up @@ -151,6 +147,10 @@ - (NSURL *)greetingImageURL {
return (URLString.length > 0) ? [NSURL URLWithString:URLString] : nil;
}

- (BOOL)showInfoButton {
return Apptentive.shared.showInfoButton;
}

#pragma mark - Status

- (NSString *)statusBody {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,11 @@ - (void)configureView {

self.greetingView.imageView.imageURL = self.viewModel.greetingImageURL;

self.greetingView.aboutButton.hidden = !self.viewModel.branding;
self.greetingView.aboutButton.tintColor = [self.viewModel.styleSheet colorForStyle:ApptentiveTextStyleHeaderMessage];
self.greetingView.isOnScreen = NO;

self.greetingView.aboutButton.hidden = !self.viewModel.showInfoButton;

[self updateHeaderFooterTextSize:nil];

[self.greetingView.aboutButton setImage:[[ApptentiveUtilities imageNamed:@"at_info"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] forState:UIControlStateNormal];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

@interface ApptentiveSurveyViewController ()

@property (strong, nonatomic) IBOutlet ApptentiveSurveyGreetingView *headerView;
@property (strong, nullable, nonatomic) IBOutlet ApptentiveSurveyGreetingView *headerView;
@property (strong, nonatomic) IBOutlet UIView *headerBackgroundView;
@property (strong, nonatomic) IBOutlet UIView *footerView;
@property (strong, nonatomic) IBOutlet UIView *footerBackgroundView;
Expand Down Expand Up @@ -80,6 +80,10 @@ - (void)viewDidLoad {
self.headerView.infoButton.accessibilityLabel = ApptentiveLocalizedString(@"About Apptentive", @"Accessibility label for 'show about' button");
[self.submitButton setTitle:self.viewModel.submitButtonText forState:UIControlStateNormal];

if (!self.viewModel.showInfoButton && self.viewModel.greeting.length == 0) {
self.headerView = nil;
}

((ApptentiveSurveyCollectionView *)self.collectionView).collectionHeaderView = self.headerView;
((ApptentiveSurveyCollectionView *)self.collectionView).collectionFooterView = self.footerView;
((ApptentiveSurveyCollectionViewLayout *)self.collectionViewLayout).shouldExpand = YES;
Expand All @@ -97,6 +101,7 @@ - (void)viewDidLoad {
self.headerView.greetingLabel.textColor = [style colorForStyle:ApptentiveTextStyleHeaderMessage];
self.headerView.infoButton.tintColor = [style colorForStyle:ApptentiveTextStyleSurveyInstructions];
self.headerView.borderView.backgroundColor = [style colorForStyle:ApptentiveColorSeparator];
self.headerView.showInfoButton = self.viewModel.showInfoButton;

self.footerBackgroundView.backgroundColor = [style colorForStyle:ApptentiveColorFooterBackground];
self.submitButton.titleLabel.font = [style fontForStyle:ApptentiveTextStyleSubmitButton];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (readonly, nonatomic) id<ApptentiveStyle> styleSheet;
@property (weak, nonatomic) id<ATSurveyViewModelDelegate> delegate;

@property (readonly, nonatomic) BOOL showInfoButton;

@property (readonly, nonatomic) NSString *title;
@property (readonly, nonatomic) NSString *greeting;
@property (readonly, nonatomic) NSString *submitButtonText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ - (NSString *)greeting {
return self.survey.surveyDescription;
}

- (BOOL)showInfoButton {
return Apptentive.shared.showInfoButton;
}

- (NSString *)submitButtonText {
return self.survey.submitText;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong, nonatomic) IBOutlet UILabel *greetingLabel;
@property (strong, nonatomic) IBOutlet UIButton *infoButton;
@property (strong, nonatomic) IBOutlet UIView *borderView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *infoButtonSpacer;

@property (assign, nonatomic) BOOL showInfoButton;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ - (void)layoutSubviews {
[super layoutSubviews];
}

- (void)setShowInfoButton:(BOOL)showInfoButton {
_showInfoButton = showInfoButton;

self.infoButton.hidden = !showInfoButton;

self.infoButtonSpacer.active = showInfoButton;
}

@end

NS_ASSUME_NONNULL_END
2 changes: 1 addition & 1 deletion Apptentive/ApptentiveTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>5.2.7</string>
<string>5.2.8</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# 2019-11-18 - v5.2.8

#### Improvements

* Add the ability to hide the About Apptentive (i) button from Message Center and Surveys.

# 2019-09-18 - v5.2.7

#### Bugs Fixed

* Fix a bugs with gesture-driven dismissal of Message Center and Surveys.
* Fix a bug with gesture-driven dismissal of Message Center and Surveys.

# 2019-09-16 - v5.2.6

Expand Down
6 changes: 3 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- apptentive-ios (5.2.7)
- apptentive-ios (5.2.8)

DEPENDENCIES:
- apptentive-ios (from `..`)
Expand All @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: ".."

SPEC CHECKSUMS:
apptentive-ios: fc0c29a9599737240b5fe93d10d2a90150fb6b7a
apptentive-ios: b6d36cb5ef582b9e5fee5104ad909c736d6bff04

PODFILE CHECKSUM: 89d2b5f4683b04482e89df6d46b268cc9ed1ef79

COCOAPODS: 1.7.5
COCOAPODS: 1.8.4
2 changes: 1 addition & 1 deletion apptentive-ios.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = 'apptentive-ios'
s.module_name = 'Apptentive'
s.version = '5.2.7'
s.version = '5.2.8'
s.license = 'BSD'
s.summary = 'Apptentive Customer Communications SDK.'
s.homepage = 'https://www.apptentive.com/'
Expand Down

0 comments on commit bff5c14

Please sign in to comment.