From be32c77fac558c29fdd13022023fec280c516c58 Mon Sep 17 00:00:00 2001 From: Tim Kelly Date: Mon, 8 May 2017 14:13:54 -0500 Subject: [PATCH] All macro to be set (DISABLE_BVSDK_IDFA) in the core module to disable API calls to ASIdentifierManager --- BVSDK.podspec | 2 +- BVSDK/Info.plist | 4 ++-- .../Swift/ConversationsExample/AppDelegate.swift | 1 - .../BVPixelEvents/BVAnalyticEventManager.m | 6 +++--- Pod/BVCommon/BVAuthenticatedUser.m | 11 +++++++++++ Pod/BVCommon/BVSDKConstants.h | 4 ++-- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/BVSDK.podspec b/BVSDK.podspec index e19c40a1..cd0a5fb3 100644 --- a/BVSDK.podspec +++ b/BVSDK.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.name = "BVSDK" - s.version = '6.5.2' + s.version = '6.5.3' s.homepage = 'https://developer.bazaarvoice.com' s.license = { :type => 'Commercial', :text => 'See https://developer.bazaarvoice.com/API_Terms_of_Use' } s.author = { 'Bazaarvoice' => 'support@bazaarvoice.com' } diff --git a/BVSDK/Info.plist b/BVSDK/Info.plist index 40cf1b3e..8f0d72f6 100644 --- a/BVSDK/Info.plist +++ b/BVSDK/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 6.5.2 + 6.5.3 CFBundleVersion - 6.5.2 + 6.5.3 LSApplicationCategoryType NSPrincipalClass diff --git a/Examples/Conversations/Swift/ConversationsExample/AppDelegate.swift b/Examples/Conversations/Swift/ConversationsExample/AppDelegate.swift index 4684468f..8e79fcf2 100644 --- a/Examples/Conversations/Swift/ConversationsExample/AppDelegate.swift +++ b/Examples/Conversations/Swift/ConversationsExample/AppDelegate.swift @@ -16,7 +16,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { // Override point for customization after application launch. - // TODO: DO NOT USE THIS CLIENTID FOR YOUR OWN APP. USE THE CLIENT ID PROVIDED BY BAZAARVOICE!!! //#warning See bvsdk_config_staging.json and bvsdk_config_product.json in the project for API key and client ID settings. BVSDKManager.configure(.staging) BVSDKManager.shared().setLogLevel(.verbose) diff --git a/Pod/BVAnalytics/BVPixelEvents/BVAnalyticEventManager.m b/Pod/BVAnalytics/BVPixelEvents/BVAnalyticEventManager.m index 72ef4f46..34ce9c44 100644 --- a/Pod/BVAnalytics/BVPixelEvents/BVAnalyticEventManager.m +++ b/Pod/BVAnalytics/BVPixelEvents/BVAnalyticEventManager.m @@ -64,12 +64,12 @@ - (NSDictionary *)getCommonAnalyticsDictAnonymous:(BOOL)anonymous { // idfa //check it limit ad tracking is enabled - NSString *idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; + NSString *idfa = @"nontracking"; +#ifndef DISABLE_BVSDK_IDFA if([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled] && !anonymous){ idfa = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; - } else { - idfa = @"nontracking"; } +#endif [params setValue:idfa forKey:@"advertisingId"]; diff --git a/Pod/BVCommon/BVAuthenticatedUser.m b/Pod/BVCommon/BVAuthenticatedUser.m index ba06a9c8..d4444afc 100644 --- a/Pod/BVCommon/BVAuthenticatedUser.m +++ b/Pod/BVCommon/BVAuthenticatedUser.m @@ -20,6 +20,9 @@ @implementation BVAuthenticatedUser -(void)updateProfile:(bool)force withAPIKey:(NSString *)passKey isStaging:(BOOL)isStage { // don't grab profile if user has opted for limited ad targeting +#ifdef DISABLE_BVSDK_IDFA + return; +#else if(![[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]){ return; } @@ -92,6 +95,9 @@ -(void)updateProfile:(bool)force withAPIKey:(NSString *)passKey isStaging:(BOOL) [profileTask resume]; } + +#endif // DISABLE_BVSDK_IDFA + } -(bool)shouldUpdateProfile { @@ -101,7 +107,12 @@ -(bool)shouldUpdateProfile { } -(NSDictionary*)getTargetingKeywords { + +#ifdef DISABLE_BVSDK_IDFA + bool trackingEnabled = false; +#else bool trackingEnabled = [[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]; +#endif if(self.personalizedPreferences == nil || !trackingEnabled) return nil; diff --git a/Pod/BVCommon/BVSDKConstants.h b/Pod/BVCommon/BVSDKConstants.h index 922b69d6..7d6b40be 100644 --- a/Pod/BVCommon/BVSDKConstants.h +++ b/Pod/BVCommon/BVSDKConstants.h @@ -11,11 +11,11 @@ /// Provides the master version of the SDK. -#define BV_SDK_VERSION @"6.5.2" +#define BV_SDK_VERSION @"6.5.3" /// Conversation SDK Version #define SDK_HEADER_NAME @"X-UA-BV-SDK" -#define SDK_HEADER_VALUE @"IOS_SDK_V652" +#define SDK_HEADER_VALUE @"IOS_SDK_V653" /// Error domain for NSError results, when present. #define BVErrDomain @"com.bvsdk.bazaarvoice"