From 569234e15fcb872fd6efa6a6a46b39111a58df1e Mon Sep 17 00:00:00 2001 From: Frank Schmitt Date: Tue, 30 Jun 2020 14:50:27 -0700 Subject: [PATCH] Apptentive IOS SDK 5.2.12 --- .../Apptentive.xcodeproj/project.pbxproj | 12 ++++-- Apptentive/Apptentive/Apptentive.h | 5 ++- Apptentive/Apptentive/Apptentive.m | 1 + Apptentive/Apptentive/DebugLogging.cer | Bin 0 -> 964 bytes Apptentive/Apptentive/Info.plist | 2 +- .../Apptentive/Misc/ApptentiveLogMonitor.m | 37 +++++++++++++++++- .../ApptentiveSurveyViewController.m | 1 + .../ApptentiveSurveyViewModel.m | 1 + Apptentive/ApptentiveTests/Info.plist | 2 +- CHANGELOG.md | 12 ++++++ Example/Podfile.lock | 6 +-- apptentive-ios.podspec | 4 +- 12 files changed, 70 insertions(+), 13 deletions(-) create mode 100644 Apptentive/Apptentive/DebugLogging.cer diff --git a/Apptentive/Apptentive.xcodeproj/project.pbxproj b/Apptentive/Apptentive.xcodeproj/project.pbxproj index 98e070bfd..e844e646f 100644 --- a/Apptentive/Apptentive.xcodeproj/project.pbxproj +++ b/Apptentive/Apptentive.xcodeproj/project.pbxproj @@ -63,6 +63,7 @@ 01626EB91EB7D60C0064E73F /* NSData+Encryption.h in Headers */ = {isa = PBXBuildFile; fileRef = 01626EB71EB7D60C0064E73F /* NSData+Encryption.h */; }; 01626EBA1EB7D60C0064E73F /* NSData+Encryption.m in Sources */ = {isa = PBXBuildFile; fileRef = 01626EB81EB7D60C0064E73F /* NSData+Encryption.m */; }; 01626EBC1EB7E5B90064E73F /* ApptentiveEncryptionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 01626EBB1EB7E5B90064E73F /* ApptentiveEncryptionTests.m */; }; + 0168B1AD24AAAFD1006EEF65 /* DebugLogging.cer in Resources */ = {isa = PBXBuildFile; fileRef = 0168B1AC24AAAFD1006EEF65 /* DebugLogging.cer */; }; 017477261EA92BED00A0A949 /* ApptentiveEventPayload.h in Headers */ = {isa = PBXBuildFile; fileRef = 0174771E1EA92BED00A0A949 /* ApptentiveEventPayload.h */; }; 017477271EA92BED00A0A949 /* ApptentiveEventPayload.m in Sources */ = {isa = PBXBuildFile; fileRef = 0174771F1EA92BED00A0A949 /* ApptentiveEventPayload.m */; }; 017477281EA92BED00A0A949 /* ApptentiveMessagePayload.h in Headers */ = {isa = PBXBuildFile; fileRef = 017477201EA92BED00A0A949 /* ApptentiveMessagePayload.h */; }; @@ -504,6 +505,7 @@ 01626EB71EB7D60C0064E73F /* NSData+Encryption.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Encryption.h"; sourceTree = ""; }; 01626EB81EB7D60C0064E73F /* NSData+Encryption.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Encryption.m"; sourceTree = ""; }; 01626EBB1EB7E5B90064E73F /* ApptentiveEncryptionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApptentiveEncryptionTests.m; sourceTree = ""; }; + 0168B1AC24AAAFD1006EEF65 /* DebugLogging.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = DebugLogging.cer; sourceTree = ""; }; 0174771E1EA92BED00A0A949 /* ApptentiveEventPayload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApptentiveEventPayload.h; sourceTree = ""; }; 0174771F1EA92BED00A0A949 /* ApptentiveEventPayload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApptentiveEventPayload.m; sourceTree = ""; }; 017477201EA92BED00A0A949 /* ApptentiveMessagePayload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApptentiveMessagePayload.h; sourceTree = ""; }; @@ -1013,6 +1015,7 @@ 01A2CF931E49062700C2103A /* Apptentive */ = { isa = PBXGroup; children = ( + 0168B1AC24AAAFD1006EEF65 /* DebugLogging.cer */, EF3FE88720A226EE00A3C9C5 /* Apptimize */, 01A2CFB01E490A9700C2103A /* Custom Views */, 01A2CFBB1E490A9700C2103A /* Engagement */, @@ -2031,6 +2034,7 @@ files = ( 01A2D1481E490A9700C2103A /* at_apptentive_logo.png in Resources */, 01A2D15D1E490A9700C2103A /* at_document.png in Resources */, + 0168B1AD24AAAFD1006EEF65 /* DebugLogging.cer in Resources */, 01A2D1681E490A9700C2103A /* at_network_error@3x.png in Resources */, 01A2D14B1E490A9700C2103A /* at_attach.png in Resources */, 01A2D1721E490A9700C2103A /* at_update_logo.png in Resources */, @@ -2405,7 +2409,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 39; + CURRENT_PROJECT_VERSION = 41; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -2463,7 +2467,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 39; + CURRENT_PROJECT_VERSION = 41; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -2495,7 +2499,7 @@ DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 86WML2UN43; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 39; + DYLIB_CURRENT_VERSION = 41; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_PREFIX_HEADER = "Apptentive/Misc/ApptentiveConnect-Prefix.pch"; GCC_PREPROCESSOR_DEFINITIONS = "APPTENTIVE_DEBUG=1"; @@ -2515,7 +2519,7 @@ DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 86WML2UN43; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 39; + DYLIB_CURRENT_VERSION = 41; DYLIB_INSTALL_NAME_BASE = "@rpath"; GCC_PREFIX_HEADER = "Apptentive/Misc/ApptentiveConnect-Prefix.pch"; INFOPLIST_FILE = Apptentive/Info.plist; diff --git a/Apptentive/Apptentive/Apptentive.h b/Apptentive/Apptentive/Apptentive.h index 1a386c71a..3598fd7dc 100644 --- a/Apptentive/Apptentive/Apptentive.h +++ b/Apptentive/Apptentive/Apptentive.h @@ -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.11" +#define kApptentiveVersionString @"5.2.12" /** The version number of the Apptentive API platform. */ #define kApptentiveAPIVersionString @"9" @@ -79,6 +79,9 @@ extern NSNotificationName const ApptentiveSurveyShownNotification; /** Notification sent when a survey is submitted by the user. */ extern NSNotificationName const ApptentiveSurveySentNotification; +/** Notification sent when a survey is cancelled. */ +extern NSNotificationName const ApptentiveSurveyCancelledNotification; + /** Notification sent when a message is sent, either by the user or using a sendAttachment method. You can use this notification to ask the user to enable push notifications. */ extern NSNotificationName const ApptentiveMessageSentNotification; diff --git a/Apptentive/Apptentive/Apptentive.m b/Apptentive/Apptentive/Apptentive.m index d964ffccb..c25cd57ae 100644 --- a/Apptentive/Apptentive/Apptentive.m +++ b/Apptentive/Apptentive/Apptentive.m @@ -35,6 +35,7 @@ NSNotificationName const ApptentiveSurveyShownNotification = @"ApptentiveSurveyShownNotification"; NSNotificationName const ApptentiveSurveySentNotification = @"ApptentiveSurveySentNotification"; +NSNotificationName const ApptentiveSurveyCancelledNotification = @"ApptentiveSurveyCancelledNotification"; NSNotificationName const ApptentiveCustomPersonDataChangedNotification = @"ApptentiveCustomPersonDataChangedNotification"; NSNotificationName const ApptentiveCustomDeviceDataChangedNotification = @"ApptentiveCustomDeviceDataChangedNotification"; diff --git a/Apptentive/Apptentive/DebugLogging.cer b/Apptentive/Apptentive/DebugLogging.cer new file mode 100644 index 0000000000000000000000000000000000000000..7ce75511852b88b4180876c349faaccd96940822 GIT binary patch literal 964 zcmXqLVm@Hd#I#}oGZP~d6C<+$FB_*;n@8JsUPeZ4RtAH{C59>nN^H!bEX+L8js*oJ zsd*)tWvL1-sY#{j3O@Pi>6v-y3eJv(k_O@+Ra`s*2vs@?o_Wc7hJptCASrGhj$jvW zg^<+5TtjXHPLL1>4^y}!jKe0(6dG(OV892GVdr5FPE9N+$w@U-GEjiKiIY)GxHu)d z*dY<_6usp9Tmw0AULykoGb1x214BbY^C)p%6A;%B$~9FjUM*`tMRBsHh zADS4IkVBu5m4Ug5k)Oe!iIIz`iII_Ek8P^e?grUg<~lL)-zPklm%S+OnW-f8rFX%R zY~QlTy@CJDA}_2A-X*vA+%KWIk((_d7uqblXKN9Cq|y23Y4@LkcaB!BsF*c<+4*CO z&+Fgs=x_=<7Ww^*Iy|4NiBa97{mQh+ATOhcNF`^RH%cRk|&5 z{#c=SK5%ODlVwI;fiDkMN$`Z8e{j{VpHqG|M}Ez0*M_FUr%&d+&6&GS@6Y_>|C;+_ zwN^H^>)t-%>7nsD()=Z|K!iYZxnI(j%RTEx|Zr^xD(L)@MniBn9p<}ej>Z2Y6pbVD_KS5T_To|kVX L{0Q)PUX%&|$f#{+ literal 0 HcmV?d00001 diff --git a/Apptentive/Apptentive/Info.plist b/Apptentive/Apptentive/Info.plist index 189efe76f..f9a07e2af 100644 --- a/Apptentive/Apptentive/Info.plist +++ b/Apptentive/Apptentive/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 5.2.11 + 5.2.12 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Apptentive/Apptentive/Misc/ApptentiveLogMonitor.m b/Apptentive/Apptentive/Misc/ApptentiveLogMonitor.m index fd22e3b3b..e3b43ec8a 100644 --- a/Apptentive/Apptentive/Misc/ApptentiveLogMonitor.m +++ b/Apptentive/Apptentive/Misc/ApptentiveLogMonitor.m @@ -74,7 +74,7 @@ + (void)startSessionWithBaseURL:(NSURL *)baseURL appKey:(NSString *)appKey signa if (session != nil) { ApptentiveLogInfo(ApptentiveLogTagMonitor, @"Previous Apptentive Log Monitor session loaded from persistent storage: %@", session); [self startSession:session]; - } else { + } else if ([self IsMobileConfigInstalled]) { // attempt to read access token from a clipboard NSString *accessToken = [self readAccessTokenFromClipboard]; if (accessToken == nil) { @@ -222,4 +222,39 @@ + (void)verifyAccessToken:(NSString *)accessToken baseURL:(NSURL *)baseURL appKe [task resume]; } +#pragma mark - +#pragma mark Configuration Profile + ++ (BOOL)IsMobileConfigInstalled { + NSString* certPath = [[NSBundle bundleForClass:self] pathForResource:@"DebugLogging" ofType:@"cer"]; + if (certPath == nil) { + return NO; + } + + NSData* certData = [NSData dataWithContentsOfFile:certPath]; + if (certData == nil) { + return NO; + } + + SecCertificateRef cert = SecCertificateCreateWithData(NULL, (__bridge CFDataRef) certData); + SecPolicyRef policy = SecPolicyCreateBasicX509(); + SecTrustRef trust; + + OSStatus err = SecTrustCreateWithCertificates((__bridge CFArrayRef) [NSArray arrayWithObject:(__bridge id)cert], policy, &trust); + + SecTrustResultType trustResult = -1; + + err = SecTrustEvaluate(trust, &trustResult); + + CFRelease(trust); + CFRelease(policy); + CFRelease(cert); + + if(trustResult == kSecTrustResultUnspecified || trustResult == kSecTrustResultProceed) { + return YES; + } else { + return NO; + } +} + @end diff --git a/Apptentive/Apptentive/Surveys/View Controllers/ApptentiveSurveyViewController.m b/Apptentive/Apptentive/Surveys/View Controllers/ApptentiveSurveyViewController.m index 982783788..4c64e3637 100644 --- a/Apptentive/Apptentive/Surveys/View Controllers/ApptentiveSurveyViewController.m +++ b/Apptentive/Apptentive/Surveys/View Controllers/ApptentiveSurveyViewController.m @@ -348,6 +348,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell otherCell.textField.tag = [self.viewModel textFieldTagForIndexPath:indexPath]; otherCell.textField.font = [self.viewModel.styleSheet fontForStyle:ApptentiveTextStyleTextInput]; otherCell.textField.textColor = [self.viewModel.styleSheet colorForStyle:ApptentiveTextStyleTextInput]; + otherCell.textField.backgroundColor = [self.viewModel.styleSheet colorForStyle:ApptentiveColorTextInputBackground]; } return cell; diff --git a/Apptentive/Apptentive/Surveys/View Controllers/ApptentiveSurveyViewModel.m b/Apptentive/Apptentive/Surveys/View Controllers/ApptentiveSurveyViewModel.m index 944839b7c..080a5a7ce 100644 --- a/Apptentive/Apptentive/Surveys/View Controllers/ApptentiveSurveyViewModel.m +++ b/Apptentive/Apptentive/Surveys/View Controllers/ApptentiveSurveyViewModel.m @@ -520,6 +520,7 @@ - (void)answerChangedAtIndexPath:(NSIndexPath *)indexPath { } - (void)didCancel:(UIViewController *)presentingViewController { + [[NSNotificationCenter defaultCenter] postNotificationName:ApptentiveSurveyCancelledNotification object:nil]; [Apptentive.shared.backend engage:ApptentiveInteractionSurveyEventLabelCancel fromInteraction:self.interaction fromViewController:presentingViewController]; } diff --git a/Apptentive/ApptentiveTests/Info.plist b/Apptentive/ApptentiveTests/Info.plist index 036166b11..dc2ac6996 100644 --- a/Apptentive/ApptentiveTests/Info.plist +++ b/Apptentive/ApptentiveTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 5.2.11 + 5.2.12 CFBundleVersion 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index fccc20096..3b37b98b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +# 2020-06-29 - v5.2.12 + +#### Improvements + +* Use configuration profile to enable log monitor. This will avoid the pasting-from-clipboard notification in iOS 14. +* Post a notification when a survey is cancelled. + +#### Bugs Fixed + +* Remove `MobileCoreServices` from the `podspec` to fix a deprecation warning. +* Fix missing background color override for "Other" question text boxes in surveys. + # 2020-04-27 - v5.2.11 #### Improvements diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 40ceb5458..12a9b1402 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - apptentive-ios (5.2.11) + - apptentive-ios (5.2.12) DEPENDENCIES: - apptentive-ios (from `..`) @@ -9,8 +9,8 @@ EXTERNAL SOURCES: :path: ".." SPEC CHECKSUMS: - apptentive-ios: 307d75a04a6f51097459dc3756ad1146eda072bd + apptentive-ios: 209e1e8c472392f7658387b113a63a8325c11a3d PODFILE CHECKSUM: 89d2b5f4683b04482e89df6d46b268cc9ed1ef79 -COCOAPODS: 1.9.0 +COCOAPODS: 1.9.1 diff --git a/apptentive-ios.podspec b/apptentive-ios.podspec index 92daf0f02..e194cdba6 100644 --- a/apptentive-ios.podspec +++ b/apptentive-ios.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'apptentive-ios' s.module_name = 'Apptentive' - s.version = '5.2.11' + s.version = '5.2.12' s.license = 'BSD' s.summary = 'Apptentive Customer Communications SDK.' s.homepage = 'https://www.apptentive.com/' @@ -10,7 +10,7 @@ Pod::Spec.new do |s| s.platform = :ios, '9.0' s.source_files = 'Apptentive/Apptentive/**/*.{h,m}' s.requires_arc = true - s.frameworks = 'AVFoundation', 'CoreData', 'CoreGraphics', 'Foundation', 'ImageIO', 'MobileCoreServices', 'QuartzCore', 'QuickLook', 'SystemConfiguration', 'UIKit' + s.frameworks = 'AVFoundation', 'CoreData', 'CoreGraphics', 'Foundation', 'ImageIO', 'QuartzCore', 'QuickLook', 'SystemConfiguration', 'UIKit' s.resource_bundle = { 'ApptentiveResources' => [ 'Apptentive/Apptentive/Model/*.xcdatamodeld', 'Apptentive/Apptentive/Model/*.xcmappingmodel',