Skip to content

Commit

Permalink
Merge pull request #293 from apptentive/branch_5.3.2
Browse files Browse the repository at this point in the history
Release 5.3.2
  • Loading branch information
frankus authored May 11, 2021
2 parents 59646a9 + 52ddb09 commit 53f08d9
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 108 deletions.
10 changes: 6 additions & 4 deletions Apptentive/Apptentive.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@
01798C001EAF94FD00633164 /* ApptentivePayloadSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApptentivePayloadSender.h; sourceTree = "<group>"; };
01798C011EAF94FD00633164 /* ApptentivePayloadSender.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApptentivePayloadSender.m; sourceTree = "<group>"; };
017E54EC1F3B860E00EA9F81 /* ApptentiveJSONSerializationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApptentiveJSONSerializationTests.m; sourceTree = "<group>"; };
01870CF72649E29E00DC8796 /* Apptentive Debug Logging.mobileconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Apptentive Debug Logging.mobileconfig"; sourceTree = "<group>"; };
018E1CDF21936B1300E58F33 /* ApptentiveEngagementTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApptentiveEngagementTests.swift; sourceTree = "<group>"; };
018E1CE121936B6600E58F33 /* conversation-4.archive */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = "conversation-4.archive"; sourceTree = "<group>"; };
018E1CE221936B6600E58F33 /* conversation-5.archive */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = "conversation-5.archive"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1021,6 +1022,7 @@
01A2CF931E49062700C2103A /* Apptentive */ = {
isa = PBXGroup;
children = (
01870CF72649E29E00DC8796 /* Apptentive Debug Logging.mobileconfig */,
0168B1AC24AAAFD1006EEF65 /* DebugLogging.cer */,
EF3FE88720A226EE00A3C9C5 /* Apptimize */,
01A2CFB01E490A9700C2103A /* Custom Views */,
Expand Down Expand Up @@ -2417,7 +2419,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 46;
CURRENT_PROJECT_VERSION = 47;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -2475,7 +2477,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 46;
CURRENT_PROJECT_VERSION = 47;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -2507,7 +2509,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 86WML2UN43;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 46;
DYLIB_CURRENT_VERSION = 47;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_PREFIX_HEADER = "Apptentive/Misc/ApptentiveConnect-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "APPTENTIVE_DEBUG=1";
Expand All @@ -2528,7 +2530,7 @@
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 86WML2UN43;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 46;
DYLIB_CURRENT_VERSION = 47;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_PREFIX_HEADER = "Apptentive/Misc/ApptentiveConnect-Prefix.pch";
INFOPLIST_FILE = Apptentive/Info.plist;
Expand Down
5 changes: 4 additions & 1 deletion Apptentive/Apptentive/Apptentive.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ - (nullable instancetype)initWithApptentiveKey:(NSString *)apptentiveKey apptent
_logLevel = ApptentiveLogLevelInfo;
_shouldSanitizeLogMessages = YES;
_showInfoButton = YES;
_enableDebugLogFile = YES;
}
return self;
}
Expand Down Expand Up @@ -155,7 +156,9 @@ - (id)initWithConfiguration:(ApptentiveConfiguration *)configuration {
_operationQueue = [ApptentiveDispatchQueue createQueueWithName:@"Apptentive Main Queue" concurrencyType:ApptentiveDispatchQueueConcurrencyTypeSerial qualityOfService:NSQualityOfServiceUserInitiated];

// start log writer
ApptentiveStartLogMonitor([ApptentiveUtilities cacheDirectoryPath:@"com.apptentive.logs"]);
if (configuration.enableDebugLogFile) {
ApptentiveStartLogMonitor([ApptentiveUtilities cacheDirectoryPath:@"com.apptentive.logs"]);
}

// start log monitor
[ApptentiveLogMonitor startSessionWithBaseURL:configuration.baseURL appKey:configuration.apptentiveKey signature:configuration.apptentiveSignature queue:_operationQueue];
Expand Down
8 changes: 7 additions & 1 deletion Apptentive/Apptentive/ApptentiveMain.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.3.1"
#define kApptentiveVersionString @"5.3.2"

/** The version number of the Apptentive API platform. */
#define kApptentiveAPIVersionString @"9"
Expand Down Expand Up @@ -162,6 +162,12 @@ typedef NS_ENUM(NSUInteger, ApptentiveLogLevel) {
/** If set, redacts potentially-sensitive information such as user data and credentials from logging. */
@property (assign, nonatomic) BOOL shouldSanitizeLogMessages;

/** If set, writes SDK-related log messages to a file in the app's cache directory (defaults to YES).
This is allows the Apptentive Debug Logging feature to capture and send logs for debugging
purposes (with explicit user opt-in). Setting this to NO will disable the debug logging feature. */
@property (assign, nonatomic) BOOL enableDebugLogFile;

/** The server URL to use for API calls. Should only be used for testing. */
@property (copy, nonatomic) NSURL *baseURL;

Expand Down
15 changes: 0 additions & 15 deletions Apptentive/Apptentive/Engagement/Model/ApptentiveDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ extern NSString *const ATDeviceLastUpdateValuePreferenceKey;
*/
@property (copy, nonatomic) NSDictionary *integrationConfiguration;

/**
The advertising identifier, if the AdSupport framework is linked, and the user has enabled it
*/
@property (readonly, nullable, strong, nonatomic) NSUUID *advertisingIdentifier;

/**
Initializes a device object with values obtained from the current device.
Expand All @@ -112,11 +107,6 @@ extern NSString *const ATDeviceLastUpdateValuePreferenceKey;
*/
+ (void)getPermanentDeviceValues;

/**
Sets static variable for advertising identifier.
*/
+ (void)getAdvertisingIdentifier;

/**
The push integration to be set globally for all devices
*/
Expand All @@ -134,11 +124,6 @@ extern NSString *const ATDeviceLastUpdateValuePreferenceKey;
*/
@property (class, strong, nonatomic) UIContentSizeCategory contentSizeCategory;

/**
Exposes the static variable _currentAdvertisingIdentifier for reading when debugging.
*/
@property (class, readonly, strong, nonatomic) NSUUID *advertisingIdentifier;

@end

NS_ASSUME_NONNULL_END
55 changes: 0 additions & 55 deletions Apptentive/Apptentive/Engagement/Model/ApptentiveDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
static NSString *const LocaleLanguageCodeKey = @"localeLanguageCode";
static NSString *const UTCOffsetKey = @"UTCOffset";
static NSString *const IntegrationConfigurationKey = @"integrationConfiguration";
static NSString *const AdvertisingIdentifierKey = @"advertisingIdentifier";

// Legacy keys
NSString *const ATDeviceLastUpdateValuePreferenceKey = @"ATDeviceLastUpdateValuePreferenceKey";
Expand All @@ -46,7 +45,6 @@
static NSDictionary *_currentIntegrationConfiguration;
static NSString *_currentCarrierName;
static UIContentSizeCategory _currentContentSizeCategory;
static NSUUID * _Nullable _currentAdvertisingIdentifier;


@implementation ApptentiveDevice
Expand Down Expand Up @@ -79,50 +77,6 @@ + (UIContentSizeCategory)contentSizeCategory {
return _currentContentSizeCategory;
}

+ (void)getAdvertisingIdentifier {
NSUUID *oldAdvertisingIdentifier = _currentAdvertisingIdentifier;
_currentAdvertisingIdentifier = nil;
@try {
Class IdentifierManager = NSClassFromString(@"ASIdentifierManager");
if (IdentifierManager) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
id sharedManager = [IdentifierManager performSelector:NSSelectorFromString(@"sharedManager")];
SEL advertisingIdentifierSelector = NSSelectorFromString(@"advertisingIdentifier");
SEL advertisingTrackingEnabledSelector = NSSelectorFromString(@"isAdvertisingTrackingEnabled");

if (![sharedManager respondsToSelector:advertisingIdentifierSelector] ||
![sharedManager respondsToSelector:advertisingTrackingEnabledSelector]) {
ApptentiveLogDebug(ApptentiveLogTagConversation, @"Unable to get advertising id: required method on ASIdentifierManager not found");
return;
}

if (![sharedManager performSelector:advertisingTrackingEnabledSelector]) {
ApptentiveLogDebug(ApptentiveLogTagConversation, @"Unable to get advertising id: advertising tracking disabled");
return;
}

NSUUID *advertisingIdentifier = [sharedManager performSelector:advertisingIdentifierSelector];
if ([advertisingIdentifier.UUIDString isEqualToString:@"00000000-0000-0000-0000-000000000000"]) {
ApptentiveLogDebug(ApptentiveLogTagConversation, @"Unable to get advertising id: invalid value");
return;
}

if (![advertisingIdentifier isEqual:oldAdvertisingIdentifier]) {
ApptentiveLogVerbose(ApptentiveLogTagConversation, @"Updated advertising id: %@", advertisingIdentifier);
}
_currentAdvertisingIdentifier = advertisingIdentifier;
#pragma clang diagnostic pop
}
} @catch (NSException *e) {
ApptentiveLogError(ApptentiveLogTagConversation, @"Exception while trying to resolve advertising id.\n%@", e);
}
}

+ (NSUUID *)advertisingIdentifier {
return _currentAdvertisingIdentifier;
}

+ (void)getPermanentDeviceValues {
_currentUUID = [UIDevice currentDevice].identifierForVendor;
_currentOSName = [UIDevice currentDevice].systemName;
Expand Down Expand Up @@ -181,7 +135,6 @@ - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {

NSSet *allowedClasses = [NSSet setWithArray:@[[NSDictionary class], [NSString class]]];
_integrationConfiguration = [aDecoder decodeObjectOfClasses:allowedClasses forKey:IntegrationConfigurationKey];
_advertisingIdentifier = [aDecoder decodeObjectOfClass:[NSUUID class] forKey:AdvertisingIdentifierKey];
}

return self;
Expand All @@ -202,7 +155,6 @@ - (void)encodeWithCoder:(NSCoder *)aCoder {
[aCoder encodeObject:self.localeLanguageCode forKey:LocaleLanguageCodeKey];
[aCoder encodeInteger:self.UTCOffset forKey:UTCOffsetKey];
[aCoder encodeObject:self.integrationConfiguration forKey:IntegrationConfigurationKey];
[aCoder encodeObject:self.advertisingIdentifier forKey:AdvertisingIdentifierKey];
}

- (instancetype)initAndMigrate {
Expand Down Expand Up @@ -252,8 +204,6 @@ - (void)updateWithCurrentDeviceValues {
_UTCOffset = [NSTimeZone systemTimeZone].secondsFromGMT;

_integrationConfiguration = ApptentiveDevice.integrationConfiguration;

_advertisingIdentifier = _currentAdvertisingIdentifier;
}

@end
Expand All @@ -273,10 +223,6 @@ - (NSString *)OSVersionString {
return self.OSVersion.versionString;
}

- (NSString *)advertisingIdentifierString {
return self.advertisingIdentifier.UUIDString;
}

+ (NSDictionary *)JSONKeyPathMapping {
return @{
@"custom_data": NSStringFromSelector(@selector(customData)),
Expand All @@ -292,7 +238,6 @@ + (NSDictionary *)JSONKeyPathMapping {
@"locale_language_code": NSStringFromSelector(@selector(localeLanguageCode)),
@"utc_offset": NSStringFromSelector(@selector(boxedUTCOffset)),
@"integration_config": NSStringFromSelector(@selector(integrationConfiguration)),
@"advertiser_id": NSStringFromSelector(@selector(advertisingIdentifierString))
};
}

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.3.1</string>
<string>5.3.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
5 changes: 0 additions & 5 deletions Apptentive/Apptentive/Model/ApptentiveAppConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (readonly, assign, nonatomic) BOOL metricsEnabled;

/**
Whether to collect the advertisingIdentifier from the AdSupport framework.
*/
@property (readonly, assign, nonatomic) BOOL collectAdvertisingIdentifier;

/**
The configuration for Message Center (see
`ApptentiveMessageCenterConfiguration`).
Expand Down
4 changes: 0 additions & 4 deletions Apptentive/Apptentive/Model/ApptentiveAppConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
static NSString *const HideBrandingKey = @"hideBranding";
static NSString *const MessageCenterEnabledKey = @"messageCenterEnabled";
static NSString *const MetricsEnabledKey = @"metricsEnabled";
static NSString *const CollectAdvertisingIdentifierKey = @"collectAdvertisingIdentifier";
static NSString *const MessageCenterKey = @"messageCenter";
static NSString *const ExpiryKey = @"expiry";

Expand Down Expand Up @@ -73,7 +72,6 @@ - (instancetype)initWithJSONDictionary:(NSDictionary *)JSONDictionary cacheLifet
_hideBranding = [JSONDictionary[@"hide_branding"] boolValue];
_messageCenterEnabled = [JSONDictionary[@"message_center_enabled"] boolValue];
_metricsEnabled = [JSONDictionary[@"metrics_enabled"] boolValue];
_collectAdvertisingIdentifier = [JSONDictionary[@"collect_ad_id"] boolValue];
_collectApptimizeData = [JSONDictionary[@"apptimize_integration"] boolValue];

_messageCenter = [[ApptentiveMessageCenterConfiguration alloc] initWithJSONDictionary:JSONDictionary[@"message_center"]];
Expand Down Expand Up @@ -119,7 +117,6 @@ - (nullable instancetype)initWithCoder:(NSCoder *)coder {
_hideBranding = [coder decodeBoolForKey:HideBrandingKey];
_messageCenterEnabled = [coder decodeBoolForKey:MessageCenterEnabledKey];
_metricsEnabled = [coder decodeBoolForKey:MetricsEnabledKey];
_collectAdvertisingIdentifier = [coder decodeBoolForKey:CollectAdvertisingIdentifierKey];
_collectApptimizeData = [coder decodeBoolForKey:CollectApptimizeDataKey];
_messageCenter = [coder decodeObjectOfClass:[ApptentiveMessageCenterConfiguration class] forKey:MessageCenterKey];
_expiry = [coder decodeObjectOfClass:[NSDate class] forKey:ExpiryKey];
Expand All @@ -135,7 +132,6 @@ - (void)encodeWithCoder:(NSCoder *)coder {
[coder encodeBool:self.hideBranding forKey:HideBrandingKey];
[coder encodeBool:self.messageCenterEnabled forKey:MessageCenterEnabledKey];
[coder encodeBool:self.metricsEnabled forKey:MetricsEnabledKey];
[coder encodeBool:self.collectAdvertisingIdentifier forKey:CollectAdvertisingIdentifierKey];
[coder encodeBool:self.collectApptimizeData forKey:CollectApptimizeDataKey];
[coder encodeObject:self.messageCenter forKey:MessageCenterKey];
[coder encodeObject:self.expiry forKey:ExpiryKey];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ - (NSString *)path {
}

- (NSDictionary *)JSONDictionary {
return @{}; // TODO: pass params?
return nil;
}

- (NSString *)conversationIdentifier {
Expand Down
17 changes: 1 addition & 16 deletions Apptentive/Apptentive/Persistence/ApptentiveBackend.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ - (instancetype)initWithApptentiveKey:(NSString *)apptentiveKey signature:(NSStr

[self loadConfiguration];

[self maybeGetAdvertisingIdentifier];
[self tryInitializeApptimizeSDK];

[self startUp];
Expand Down Expand Up @@ -235,7 +234,6 @@ - (void)applicationWillEnterForegroundNotification:(NSNotification *)notificatio
[self resume];
[self.conversationManager.activeConversation startSession];
[self addLaunchMetric];
[self maybeGetAdvertisingIdentifier];
}];
}

Expand Down Expand Up @@ -453,7 +451,6 @@ - (void)processConfigurationResponse:(NSDictionary *)configurationResponse cache

[self saveConfiguration];

[self maybeGetAdvertisingIdentifier];
[self tryUpdateApptimizeData];
}

Expand Down Expand Up @@ -795,18 +792,6 @@ - (ApptentiveMessageManager *)messageManager {
return self.conversationManager.messageManager;
}

#pragma mark -
#pragma mark Advertising Identifier

- (void)maybeGetAdvertisingIdentifier {
ApptentiveAssertOperationQueue(self.operationQueue);

if (self.configuration.collectAdvertisingIdentifier) {
[ApptentiveDevice getAdvertisingIdentifier];
[self scheduleDeviceUpdate];
}
}

#pragma mark -
#pragma mark Apptimize SDK

Expand All @@ -819,7 +804,7 @@ - (void)tryInitializeApptimizeSDK {
}

if (![ApptentiveApptimize isApptimizeSDKAvailable]) {
ApptentiveLogWarning(ApptentiveLogTagApptimize, @"Unable to initialize Apptimize SDK support: SDK integration not found");
ApptentiveLogInfo(ApptentiveLogTagApptimize, @"Unable to initialize Apptimize SDK support: SDK integration not found");
return;
}

Expand Down
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.3.1</string>
<string>5.3.2</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# 2021-05-11 - v5.3.2

#### Improvements

* Add property on configuration to disable writing debug logs to disk

#### Bugs Fixed

* Don't send a body with GET request to upgrade auth token to JWT

# 2020-09-16 - v5.3.1

#### Improvements
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.3.1)
- apptentive-ios (5.3.2)

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

SPEC CHECKSUMS:
apptentive-ios: 94a2e90b4759051a3b73e6e2ae85f16361e20b9c
apptentive-ios: 8254c0c93038b951a196b7912b5e9760ecb4b080

PODFILE CHECKSUM: 785a9d76c0ca2535819b754c6fe8c5c6413dbc30

COCOAPODS: 1.10.0.beta.2
COCOAPODS: 1.10.1
Loading

0 comments on commit 53f08d9

Please sign in to comment.