Skip to content

Commit

Permalink
All macro to be set (DISABLE_BVSDK_IDFA) in the core module to disabl…
Browse files Browse the repository at this point in the history
…e API calls to ASIdentifierManager
  • Loading branch information
Tim Kelly committed May 9, 2017
1 parent 637fe43 commit be32c77
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion BVSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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' => '[email protected]' }
Expand Down
4 changes: 2 additions & 2 deletions BVSDK/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>6.5.2</string>
<string>6.5.3</string>
<key>CFBundleVersion</key>
<string>6.5.2</string>
<string>6.5.3</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>NSPrincipalClass</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions Pod/BVAnalytics/BVPixelEvents/BVAnalyticEventManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"];

Expand Down
11 changes: 11 additions & 0 deletions Pod/BVCommon/BVAuthenticatedUser.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -92,6 +95,9 @@ -(void)updateProfile:(bool)force withAPIKey:(NSString *)passKey isStaging:(BOOL)
[profileTask resume];

}

#endif // DISABLE_BVSDK_IDFA

}

-(bool)shouldUpdateProfile {
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Pod/BVCommon/BVSDKConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit be32c77

Please sign in to comment.