3333NSString * const BRANCH_PREFS_KEY_SESSION_PARAMS = @" bnc_session_params" ;
3434NSString * const BRANCH_PREFS_KEY_INSTALL_PARAMS = @" bnc_install_params" ;
3535NSString * const BRANCH_PREFS_KEY_USER_URL = @" bnc_user_url" ;
36- NSString * const BRANCH_PREFS_KEY_IS_REFERRABLE = @" bnc_is_referrable" ;
3736NSString * const BRANCH_PREFS_KEY_BRANCH_UNIVERSAL_LINK_DOMAINS = @" branch_universal_link_domains" ;
3837NSString * const BRANCH_REQUEST_KEY_EXTERNAL_INTENT_URI = @" external_intent_uri" ;
3938
4039NSString * const BRANCH_PREFS_KEY_CREDITS = @" bnc_credits" ;
4140NSString * const BRANCH_PREFS_KEY_CREDIT_BASE = @" bnc_credit_base_" ;
4241
43- NSString * const BRANCH_PREFS_KEY_COUNTS = @" bnc_counts" ;
44- NSString * const BRANCH_PREFS_KEY_TOTAL_BASE = @" bnc_total_base_" ;
45- NSString * const BRANCH_PREFS_KEY_UNIQUE_BASE = @" bnc_unique_base_" ;
46-
4742NSString * const BRANCH_PREFS_KEY_BRANCH_VIEW_USAGE_CNT = @" bnc_branch_view_usage_cnt_" ;
4843
4944// The name of this key was specified in the account-creation API integration
5247@interface BNCPreferenceHelper ()
5348
5449@property (strong , nonatomic ) NSMutableDictionary *persistenceDict;
55- @property (strong , nonatomic ) NSMutableDictionary *countsDictionary;
5650@property (strong , nonatomic ) NSMutableDictionary *creditsDictionary;
5751@property (strong , nonatomic ) NSMutableDictionary *requestMetadataDictionary;
5852@property (assign , nonatomic ) BOOL isUsingLiveKey;
@@ -76,7 +70,6 @@ @implementation BNCPreferenceHelper
7670 installParams = _installParams,
7771 universalLinkUrl = _universalLinkUrl,
7872 externalIntentURI = _externalIntentURI,
79- isReferrable = _isReferrable,
8073 isDebug = _isDebug,
8174 shouldWaitForInit = _shouldWaitForInit,
8275 suppressWarningLogs = _suppressWarningLogs,
@@ -106,8 +99,6 @@ - (id)init {
10699
107100 _isDebug = NO ;
108101 _suppressWarningLogs = NO ;
109- _explicitlyRequestedReferrable = NO ;
110- _isReferrable = [self readBoolFromDefaults: BRANCH_PREFS_KEY_IS_REFERRABLE];
111102 }
112103
113104 return self;
@@ -448,29 +439,8 @@ - (void)setCheckedFacebookAppLinks:(BOOL)checked {
448439 [self writeBoolToDefaults: BRANCH_PREFS_KEY_CHECKED_FACEBOOK_APP_LINKS value: checked];
449440}
450441
451- - (BOOL )isReferrable {
452- BOOL hasIdentity = self.identityID != nil ;
453-
454- // If referrable is set, but they already have an identity, they should only
455- // still be referrable if the dev has explicitly set always referrable.
456- if (_isReferrable && hasIdentity) {
457- return _explicitlyRequestedReferrable;
458- }
459-
460- // If not referrable, or no identity yet, whatever isReferrable has is fine to return.
461- return _isReferrable;
462- }
463-
464- - (void )setIsReferrable : (BOOL )isReferrable {
465- if (_isReferrable != isReferrable) {
466- _isReferrable = isReferrable;
467- [self writeBoolToDefaults: BRANCH_PREFS_KEY_IS_REFERRABLE value: isReferrable];
468- }
469- }
470-
471442- (void )clearUserCreditsAndCounts {
472443 self.creditsDictionary = [[NSMutableDictionary alloc ] init ];
473- self.countsDictionary = [[NSMutableDictionary alloc ] init ];
474444}
475445
476446- (id )getBranchUniversalLinkDomains {
@@ -552,38 +522,6 @@ - (void)clearUserCredits {
552522
553523#pragma mark - Count Storage
554524
555- - (NSMutableDictionary *)countsDictionary {
556- if (!_countsDictionary) {
557- _countsDictionary = [[self readObjectFromDefaults: BRANCH_PREFS_KEY_COUNTS] mutableCopy ];
558-
559- if (!_countsDictionary) {
560- _countsDictionary = [[NSMutableDictionary alloc ] init ];
561- }
562- }
563-
564- return _countsDictionary;
565- }
566-
567- - (void )setActionTotalCount : (NSString *)action withCount : (NSInteger )count {
568- self.countsDictionary [[BRANCH_PREFS_KEY_TOTAL_BASE stringByAppendingString: action]] = @(count);
569-
570- [self writeObjectToDefaults: BRANCH_PREFS_KEY_COUNTS value: self .countsDictionary];
571- }
572-
573- - (void )setActionUniqueCount : (NSString *)action withCount : (NSInteger )count {
574- self.countsDictionary [[BRANCH_PREFS_KEY_UNIQUE_BASE stringByAppendingString: action]] = @(count);
575-
576- [self writeObjectToDefaults: BRANCH_PREFS_KEY_COUNTS value: self .countsDictionary];
577- }
578-
579- - (NSInteger )getActionTotalCount : (NSString *)action {
580- return [self .countsDictionary[[BRANCH_PREFS_KEY_TOTAL_BASE stringByAppendingString: action]] integerValue ];
581- }
582-
583- - (NSInteger )getActionUniqueCount : (NSString *)action {
584- return [self .countsDictionary[[BRANCH_PREFS_KEY_UNIQUE_BASE stringByAppendingString: action]] integerValue ];
585- }
586-
587525- (void )updateBranchViewCount : (NSString *)branchViewID {
588526 NSInteger currentCount = [self getBranchViewCount: branchViewID] + 1 ;
589527 [self writeObjectToDefaults: [BRANCH_PREFS_KEY_BRANCH_VIEW_USAGE_CNT stringByAppendingString: branchViewID] value: @(currentCount)];
0 commit comments