Skip to content

Commit 53f08d9

Browse files
authored
Merge pull request #293 from apptentive/branch_5.3.2
Release 5.3.2
2 parents 59646a9 + 52ddb09 commit 53f08d9

14 files changed

+35
-108
lines changed

Apptentive/Apptentive.xcodeproj/project.pbxproj

+6-4
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@
526526
01798C001EAF94FD00633164 /* ApptentivePayloadSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApptentivePayloadSender.h; sourceTree = "<group>"; };
527527
01798C011EAF94FD00633164 /* ApptentivePayloadSender.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApptentivePayloadSender.m; sourceTree = "<group>"; };
528528
017E54EC1F3B860E00EA9F81 /* ApptentiveJSONSerializationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApptentiveJSONSerializationTests.m; sourceTree = "<group>"; };
529+
01870CF72649E29E00DC8796 /* Apptentive Debug Logging.mobileconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Apptentive Debug Logging.mobileconfig"; sourceTree = "<group>"; };
529530
018E1CDF21936B1300E58F33 /* ApptentiveEngagementTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApptentiveEngagementTests.swift; sourceTree = "<group>"; };
530531
018E1CE121936B6600E58F33 /* conversation-4.archive */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = "conversation-4.archive"; sourceTree = "<group>"; };
531532
018E1CE221936B6600E58F33 /* conversation-5.archive */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = "conversation-5.archive"; sourceTree = "<group>"; };
@@ -1021,6 +1022,7 @@
10211022
01A2CF931E49062700C2103A /* Apptentive */ = {
10221023
isa = PBXGroup;
10231024
children = (
1025+
01870CF72649E29E00DC8796 /* Apptentive Debug Logging.mobileconfig */,
10241026
0168B1AC24AAAFD1006EEF65 /* DebugLogging.cer */,
10251027
EF3FE88720A226EE00A3C9C5 /* Apptimize */,
10261028
01A2CFB01E490A9700C2103A /* Custom Views */,
@@ -2417,7 +2419,7 @@
24172419
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
24182420
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
24192421
COPY_PHASE_STRIP = NO;
2420-
CURRENT_PROJECT_VERSION = 46;
2422+
CURRENT_PROJECT_VERSION = 47;
24212423
DEBUG_INFORMATION_FORMAT = dwarf;
24222424
ENABLE_STRICT_OBJC_MSGSEND = YES;
24232425
ENABLE_TESTABILITY = YES;
@@ -2475,7 +2477,7 @@
24752477
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
24762478
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
24772479
COPY_PHASE_STRIP = NO;
2478-
CURRENT_PROJECT_VERSION = 46;
2480+
CURRENT_PROJECT_VERSION = 47;
24792481
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
24802482
ENABLE_NS_ASSERTIONS = NO;
24812483
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -2507,7 +2509,7 @@
25072509
DEFINES_MODULE = YES;
25082510
DEVELOPMENT_TEAM = 86WML2UN43;
25092511
DYLIB_COMPATIBILITY_VERSION = 1;
2510-
DYLIB_CURRENT_VERSION = 46;
2512+
DYLIB_CURRENT_VERSION = 47;
25112513
DYLIB_INSTALL_NAME_BASE = "@rpath";
25122514
GCC_PREFIX_HEADER = "Apptentive/Misc/ApptentiveConnect-Prefix.pch";
25132515
GCC_PREPROCESSOR_DEFINITIONS = "APPTENTIVE_DEBUG=1";
@@ -2528,7 +2530,7 @@
25282530
DEFINES_MODULE = YES;
25292531
DEVELOPMENT_TEAM = 86WML2UN43;
25302532
DYLIB_COMPATIBILITY_VERSION = 1;
2531-
DYLIB_CURRENT_VERSION = 46;
2533+
DYLIB_CURRENT_VERSION = 47;
25322534
DYLIB_INSTALL_NAME_BASE = "@rpath";
25332535
GCC_PREFIX_HEADER = "Apptentive/Misc/ApptentiveConnect-Prefix.pch";
25342536
INFOPLIST_FILE = Apptentive/Info.plist;

Apptentive/Apptentive/Apptentive.m

+4-1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ - (nullable instancetype)initWithApptentiveKey:(NSString *)apptentiveKey apptent
103103
_logLevel = ApptentiveLogLevelInfo;
104104
_shouldSanitizeLogMessages = YES;
105105
_showInfoButton = YES;
106+
_enableDebugLogFile = YES;
106107
}
107108
return self;
108109
}
@@ -155,7 +156,9 @@ - (id)initWithConfiguration:(ApptentiveConfiguration *)configuration {
155156
_operationQueue = [ApptentiveDispatchQueue createQueueWithName:@"Apptentive Main Queue" concurrencyType:ApptentiveDispatchQueueConcurrencyTypeSerial qualityOfService:NSQualityOfServiceUserInitiated];
156157

157158
// start log writer
158-
ApptentiveStartLogMonitor([ApptentiveUtilities cacheDirectoryPath:@"com.apptentive.logs"]);
159+
if (configuration.enableDebugLogFile) {
160+
ApptentiveStartLogMonitor([ApptentiveUtilities cacheDirectoryPath:@"com.apptentive.logs"]);
161+
}
159162

160163
// start log monitor
161164
[ApptentiveLogMonitor startSessionWithBaseURL:configuration.baseURL appKey:configuration.apptentiveKey signature:configuration.apptentiveSignature queue:_operationQueue];

Apptentive/Apptentive/ApptentiveMain.h

+7-1
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.3.1"
23+
#define kApptentiveVersionString @"5.3.2"
2424

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

165+
/** If set, writes SDK-related log messages to a file in the app's cache directory (defaults to YES).
166+
167+
This is allows the Apptentive Debug Logging feature to capture and send logs for debugging
168+
purposes (with explicit user opt-in). Setting this to NO will disable the debug logging feature. */
169+
@property (assign, nonatomic) BOOL enableDebugLogFile;
170+
165171
/** The server URL to use for API calls. Should only be used for testing. */
166172
@property (copy, nonatomic) NSURL *baseURL;
167173

Apptentive/Apptentive/Engagement/Model/ApptentiveDevice.h

-15
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ extern NSString *const ATDeviceLastUpdateValuePreferenceKey;
9090
*/
9191
@property (copy, nonatomic) NSDictionary *integrationConfiguration;
9292

93-
/**
94-
The advertising identifier, if the AdSupport framework is linked, and the user has enabled it
95-
*/
96-
@property (readonly, nullable, strong, nonatomic) NSUUID *advertisingIdentifier;
97-
9893
/**
9994
Initializes a device object with values obtained from the current device.
10095
@@ -112,11 +107,6 @@ extern NSString *const ATDeviceLastUpdateValuePreferenceKey;
112107
*/
113108
+ (void)getPermanentDeviceValues;
114109

115-
/**
116-
Sets static variable for advertising identifier.
117-
*/
118-
+ (void)getAdvertisingIdentifier;
119-
120110
/**
121111
The push integration to be set globally for all devices
122112
*/
@@ -134,11 +124,6 @@ extern NSString *const ATDeviceLastUpdateValuePreferenceKey;
134124
*/
135125
@property (class, strong, nonatomic) UIContentSizeCategory contentSizeCategory;
136126

137-
/**
138-
Exposes the static variable _currentAdvertisingIdentifier for reading when debugging.
139-
*/
140-
@property (class, readonly, strong, nonatomic) NSUUID *advertisingIdentifier;
141-
142127
@end
143128

144129
NS_ASSUME_NONNULL_END

Apptentive/Apptentive/Engagement/Model/ApptentiveDevice.m

-55
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
static NSString *const LocaleLanguageCodeKey = @"localeLanguageCode";
3131
static NSString *const UTCOffsetKey = @"UTCOffset";
3232
static NSString *const IntegrationConfigurationKey = @"integrationConfiguration";
33-
static NSString *const AdvertisingIdentifierKey = @"advertisingIdentifier";
3433

3534
// Legacy keys
3635
NSString *const ATDeviceLastUpdateValuePreferenceKey = @"ATDeviceLastUpdateValuePreferenceKey";
@@ -46,7 +45,6 @@
4645
static NSDictionary *_currentIntegrationConfiguration;
4746
static NSString *_currentCarrierName;
4847
static UIContentSizeCategory _currentContentSizeCategory;
49-
static NSUUID * _Nullable _currentAdvertisingIdentifier;
5048

5149

5250
@implementation ApptentiveDevice
@@ -79,50 +77,6 @@ + (UIContentSizeCategory)contentSizeCategory {
7977
return _currentContentSizeCategory;
8078
}
8179

82-
+ (void)getAdvertisingIdentifier {
83-
NSUUID *oldAdvertisingIdentifier = _currentAdvertisingIdentifier;
84-
_currentAdvertisingIdentifier = nil;
85-
@try {
86-
Class IdentifierManager = NSClassFromString(@"ASIdentifierManager");
87-
if (IdentifierManager) {
88-
#pragma clang diagnostic push
89-
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
90-
id sharedManager = [IdentifierManager performSelector:NSSelectorFromString(@"sharedManager")];
91-
SEL advertisingIdentifierSelector = NSSelectorFromString(@"advertisingIdentifier");
92-
SEL advertisingTrackingEnabledSelector = NSSelectorFromString(@"isAdvertisingTrackingEnabled");
93-
94-
if (![sharedManager respondsToSelector:advertisingIdentifierSelector] ||
95-
![sharedManager respondsToSelector:advertisingTrackingEnabledSelector]) {
96-
ApptentiveLogDebug(ApptentiveLogTagConversation, @"Unable to get advertising id: required method on ASIdentifierManager not found");
97-
return;
98-
}
99-
100-
if (![sharedManager performSelector:advertisingTrackingEnabledSelector]) {
101-
ApptentiveLogDebug(ApptentiveLogTagConversation, @"Unable to get advertising id: advertising tracking disabled");
102-
return;
103-
}
104-
105-
NSUUID *advertisingIdentifier = [sharedManager performSelector:advertisingIdentifierSelector];
106-
if ([advertisingIdentifier.UUIDString isEqualToString:@"00000000-0000-0000-0000-000000000000"]) {
107-
ApptentiveLogDebug(ApptentiveLogTagConversation, @"Unable to get advertising id: invalid value");
108-
return;
109-
}
110-
111-
if (![advertisingIdentifier isEqual:oldAdvertisingIdentifier]) {
112-
ApptentiveLogVerbose(ApptentiveLogTagConversation, @"Updated advertising id: %@", advertisingIdentifier);
113-
}
114-
_currentAdvertisingIdentifier = advertisingIdentifier;
115-
#pragma clang diagnostic pop
116-
}
117-
} @catch (NSException *e) {
118-
ApptentiveLogError(ApptentiveLogTagConversation, @"Exception while trying to resolve advertising id.\n%@", e);
119-
}
120-
}
121-
122-
+ (NSUUID *)advertisingIdentifier {
123-
return _currentAdvertisingIdentifier;
124-
}
125-
12680
+ (void)getPermanentDeviceValues {
12781
_currentUUID = [UIDevice currentDevice].identifierForVendor;
12882
_currentOSName = [UIDevice currentDevice].systemName;
@@ -181,7 +135,6 @@ - (nullable instancetype)initWithCoder:(NSCoder *)aDecoder {
181135

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

187140
return self;
@@ -202,7 +155,6 @@ - (void)encodeWithCoder:(NSCoder *)aCoder {
202155
[aCoder encodeObject:self.localeLanguageCode forKey:LocaleLanguageCodeKey];
203156
[aCoder encodeInteger:self.UTCOffset forKey:UTCOffsetKey];
204157
[aCoder encodeObject:self.integrationConfiguration forKey:IntegrationConfigurationKey];
205-
[aCoder encodeObject:self.advertisingIdentifier forKey:AdvertisingIdentifierKey];
206158
}
207159

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

254206
_integrationConfiguration = ApptentiveDevice.integrationConfiguration;
255-
256-
_advertisingIdentifier = _currentAdvertisingIdentifier;
257207
}
258208

259209
@end
@@ -273,10 +223,6 @@ - (NSString *)OSVersionString {
273223
return self.OSVersion.versionString;
274224
}
275225

276-
- (NSString *)advertisingIdentifierString {
277-
return self.advertisingIdentifier.UUIDString;
278-
}
279-
280226
+ (NSDictionary *)JSONKeyPathMapping {
281227
return @{
282228
@"custom_data": NSStringFromSelector(@selector(customData)),
@@ -292,7 +238,6 @@ + (NSDictionary *)JSONKeyPathMapping {
292238
@"locale_language_code": NSStringFromSelector(@selector(localeLanguageCode)),
293239
@"utc_offset": NSStringFromSelector(@selector(boxedUTCOffset)),
294240
@"integration_config": NSStringFromSelector(@selector(integrationConfiguration)),
295-
@"advertiser_id": NSStringFromSelector(@selector(advertisingIdentifierString))
296241
};
297242
}
298243

Apptentive/Apptentive/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>5.3.1</string>
18+
<string>5.3.2</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSPrincipalClass</key>

Apptentive/Apptentive/Model/ApptentiveAppConfiguration.h

-5
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@ NS_ASSUME_NONNULL_BEGIN
113113
*/
114114
@property (readonly, assign, nonatomic) BOOL metricsEnabled;
115115

116-
/**
117-
Whether to collect the advertisingIdentifier from the AdSupport framework.
118-
*/
119-
@property (readonly, assign, nonatomic) BOOL collectAdvertisingIdentifier;
120-
121116
/**
122117
The configuration for Message Center (see
123118
`ApptentiveMessageCenterConfiguration`).

Apptentive/Apptentive/Model/ApptentiveAppConfiguration.m

-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
static NSString *const HideBrandingKey = @"hideBranding";
1818
static NSString *const MessageCenterEnabledKey = @"messageCenterEnabled";
1919
static NSString *const MetricsEnabledKey = @"metricsEnabled";
20-
static NSString *const CollectAdvertisingIdentifierKey = @"collectAdvertisingIdentifier";
2120
static NSString *const MessageCenterKey = @"messageCenter";
2221
static NSString *const ExpiryKey = @"expiry";
2322

@@ -73,7 +72,6 @@ - (instancetype)initWithJSONDictionary:(NSDictionary *)JSONDictionary cacheLifet
7372
_hideBranding = [JSONDictionary[@"hide_branding"] boolValue];
7473
_messageCenterEnabled = [JSONDictionary[@"message_center_enabled"] boolValue];
7574
_metricsEnabled = [JSONDictionary[@"metrics_enabled"] boolValue];
76-
_collectAdvertisingIdentifier = [JSONDictionary[@"collect_ad_id"] boolValue];
7775
_collectApptimizeData = [JSONDictionary[@"apptimize_integration"] boolValue];
7876

7977
_messageCenter = [[ApptentiveMessageCenterConfiguration alloc] initWithJSONDictionary:JSONDictionary[@"message_center"]];
@@ -119,7 +117,6 @@ - (nullable instancetype)initWithCoder:(NSCoder *)coder {
119117
_hideBranding = [coder decodeBoolForKey:HideBrandingKey];
120118
_messageCenterEnabled = [coder decodeBoolForKey:MessageCenterEnabledKey];
121119
_metricsEnabled = [coder decodeBoolForKey:MetricsEnabledKey];
122-
_collectAdvertisingIdentifier = [coder decodeBoolForKey:CollectAdvertisingIdentifierKey];
123120
_collectApptimizeData = [coder decodeBoolForKey:CollectApptimizeDataKey];
124121
_messageCenter = [coder decodeObjectOfClass:[ApptentiveMessageCenterConfiguration class] forKey:MessageCenterKey];
125122
_expiry = [coder decodeObjectOfClass:[NSDate class] forKey:ExpiryKey];
@@ -135,7 +132,6 @@ - (void)encodeWithCoder:(NSCoder *)coder {
135132
[coder encodeBool:self.hideBranding forKey:HideBrandingKey];
136133
[coder encodeBool:self.messageCenterEnabled forKey:MessageCenterEnabledKey];
137134
[coder encodeBool:self.metricsEnabled forKey:MetricsEnabledKey];
138-
[coder encodeBool:self.collectAdvertisingIdentifier forKey:CollectAdvertisingIdentifierKey];
139135
[coder encodeBool:self.collectApptimizeData forKey:CollectApptimizeDataKey];
140136
[coder encodeObject:self.messageCenter forKey:MessageCenterKey];
141137
[coder encodeObject:self.expiry forKey:ExpiryKey];

Apptentive/Apptentive/Networking/Requests & Payloads/ApptentiveLegacyConversationRequest.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ - (NSString *)path {
3535
}
3636

3737
- (NSDictionary *)JSONDictionary {
38-
return @{}; // TODO: pass params?
38+
return nil;
3939
}
4040

4141
- (NSString *)conversationIdentifier {

Apptentive/Apptentive/Persistence/ApptentiveBackend.m

+1-16
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ - (instancetype)initWithApptentiveKey:(NSString *)apptentiveKey signature:(NSStr
122122

123123
[self loadConfiguration];
124124

125-
[self maybeGetAdvertisingIdentifier];
126125
[self tryInitializeApptimizeSDK];
127126

128127
[self startUp];
@@ -235,7 +234,6 @@ - (void)applicationWillEnterForegroundNotification:(NSNotification *)notificatio
235234
[self resume];
236235
[self.conversationManager.activeConversation startSession];
237236
[self addLaunchMetric];
238-
[self maybeGetAdvertisingIdentifier];
239237
}];
240238
}
241239

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

454452
[self saveConfiguration];
455453

456-
[self maybeGetAdvertisingIdentifier];
457454
[self tryUpdateApptimizeData];
458455
}
459456

@@ -795,18 +792,6 @@ - (ApptentiveMessageManager *)messageManager {
795792
return self.conversationManager.messageManager;
796793
}
797794

798-
#pragma mark -
799-
#pragma mark Advertising Identifier
800-
801-
- (void)maybeGetAdvertisingIdentifier {
802-
ApptentiveAssertOperationQueue(self.operationQueue);
803-
804-
if (self.configuration.collectAdvertisingIdentifier) {
805-
[ApptentiveDevice getAdvertisingIdentifier];
806-
[self scheduleDeviceUpdate];
807-
}
808-
}
809-
810795
#pragma mark -
811796
#pragma mark Apptimize SDK
812797

@@ -819,7 +804,7 @@ - (void)tryInitializeApptimizeSDK {
819804
}
820805

821806
if (![ApptentiveApptimize isApptimizeSDKAvailable]) {
822-
ApptentiveLogWarning(ApptentiveLogTagApptimize, @"Unable to initialize Apptimize SDK support: SDK integration not found");
807+
ApptentiveLogInfo(ApptentiveLogTagApptimize, @"Unable to initialize Apptimize SDK support: SDK integration not found");
823808
return;
824809
}
825810

Apptentive/ApptentiveTests/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>BNDL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>5.3.1</string>
18+
<string>5.3.2</string>
1919
<key>CFBundleVersion</key>
2020
<string>1</string>
2121
</dict>

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# 2021-05-11 - v5.3.2
2+
3+
#### Improvements
4+
5+
* Add property on configuration to disable writing debug logs to disk
6+
7+
#### Bugs Fixed
8+
9+
* Don't send a body with GET request to upgrade auth token to JWT
10+
111
# 2020-09-16 - v5.3.1
212

313
#### Improvements

Example/Podfile.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- apptentive-ios (5.3.1)
2+
- apptentive-ios (5.3.2)
33

44
DEPENDENCIES:
55
- apptentive-ios (from `..`)
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: ".."
1010

1111
SPEC CHECKSUMS:
12-
apptentive-ios: 94a2e90b4759051a3b73e6e2ae85f16361e20b9c
12+
apptentive-ios: 8254c0c93038b951a196b7912b5e9760ecb4b080
1313

1414
PODFILE CHECKSUM: 785a9d76c0ca2535819b754c6fe8c5c6413dbc30
1515

16-
COCOAPODS: 1.10.0.beta.2
16+
COCOAPODS: 1.10.1

0 commit comments

Comments
 (0)