Skip to content

Commit 6a8c5da

Browse files
author
Dan Walkowski
committed
Merge pull request #264 from BranchMetrics/fftl-disabler
Fftl disabler
2 parents 453aebc + 4570d39 commit 6a8c5da

17 files changed

+25
-519
lines changed

Branch-SDK/Branch-SDK/BNCPreferenceHelper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
@property (assign, nonatomic) BOOL explicitlyRequestedReferrable;
3232
@property (assign, nonatomic) BOOL isReferrable;
3333
@property (assign, nonatomic) BOOL isDebug;
34-
@property (assign, nonatomic) BOOL isConnectedToRemoteDebug;
3534
@property (assign, nonatomic) BOOL isContinuingUserActivity;
3635
@property (assign, nonatomic) NSInteger retryCount;
3736
@property (assign, nonatomic) NSTimeInterval retryInterval;

Branch-SDK/Branch-SDK/BNCPreferenceHelper.m

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,28 @@ @interface BNCPreferenceHelper ()
5252

5353
@implementation BNCPreferenceHelper
5454

55-
@synthesize branchKey = _branchKey, appKey = _appKey, lastRunBranchKey = _lastRunBranchKey, appVersion = _appVersion, deviceFingerprintID = _deviceFingerprintID, sessionID = _sessionID, spotlightIdentifier = _spotlightIdentifier,
56-
identityID = _identityID, linkClickIdentifier = _linkClickIdentifier, userUrl = _userUrl, userIdentity = _userIdentity, sessionParams = _sessionParams, installParams = _installParams, universalLinkUrl = _universalLinkUrl, externalIntentURI = _externalIntentURI,
57-
isReferrable = _isReferrable, isDebug = _isDebug, isConnectedToRemoteDebug = _isConnectedToRemoteDebug, isContinuingUserActivity = _isContinuingUserActivity, retryCount = _retryCount, retryInterval = _retryInterval, timeout = _timeout, lastStrongMatchDate = _lastStrongMatchDate;
55+
@synthesize branchKey = _branchKey,
56+
appKey = _appKey,
57+
lastRunBranchKey = _lastRunBranchKey,
58+
appVersion = _appVersion,
59+
deviceFingerprintID = _deviceFingerprintID,
60+
sessionID = _sessionID,
61+
spotlightIdentifier = _spotlightIdentifier,
62+
identityID = _identityID,
63+
linkClickIdentifier = _linkClickIdentifier,
64+
userUrl = _userUrl,
65+
userIdentity = _userIdentity,
66+
sessionParams = _sessionParams,
67+
installParams = _installParams,
68+
universalLinkUrl = _universalLinkUrl,
69+
externalIntentURI = _externalIntentURI,
70+
isReferrable = _isReferrable,
71+
isDebug = _isDebug,
72+
isContinuingUserActivity = _isContinuingUserActivity,
73+
retryCount = _retryCount,
74+
retryInterval = _retryInterval,
75+
timeout = _timeout,
76+
lastStrongMatchDate = _lastStrongMatchDate;
5877

5978
+ (BNCPreferenceHelper *)preferenceHelper {
6079
static BNCPreferenceHelper *preferenceHelper;
@@ -74,7 +93,6 @@ - (id)init {
7493
_retryInterval = DEFAULT_RETRY_INTERVAL;
7594

7695
_isDebug = NO;
77-
_isConnectedToRemoteDebug = NO;
7896
_explicitlyRequestedReferrable = NO;
7997
_isReferrable = [self readBoolFromDefaults:BRANCH_PREFS_KEY_IS_REFERRABLE];
8098
}
@@ -114,10 +132,6 @@ - (void)log:(NSString *)filename line:(int)line message:(NSString *)format, ...
114132
NSString *log = [NSString stringWithFormat:@"[%@:%d] %@", filename, line, [[NSString alloc] initWithFormat:format arguments:args]];
115133
va_end(args);
116134
NSLog(@"%@", log);
117-
118-
if (self.isConnectedToRemoteDebug) {
119-
[[Branch getInstance] log:log];
120-
}
121135
}
122136
}
123137

Branch-SDK/Branch-SDK/BNCServerRequestQueue.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#import "BNCPreferenceHelper.h"
1111
#import "BranchCloseRequest.h"
1212
#import "BranchOpenRequest.h"
13-
#import "BNCDebugRequest.h"
1413

1514
NSString * const BRANCH_QUEUE_FILE = @"BNCServerRequestQueue";
1615
NSUInteger const BATCH_WRITE_TIMEOUT = 3;
@@ -199,7 +198,7 @@ - (void)persistToDisk {
199198
NSMutableArray *encodedRequests = [[NSMutableArray alloc] init];
200199
for (BNCServerRequest *req in requestsToPersist) {
201200
// Don't persist these requests
202-
if ([req isKindOfClass:[BranchCloseRequest class]] || [req isKindOfClass:[BNCDebugRequest class]]) {
201+
if ([req isKindOfClass:[BranchCloseRequest class]]) {
203202
continue;
204203
}
205204

@@ -250,7 +249,7 @@ - (void)retrieve {
250249
}
251250

252251
// Throw out persisted close requests
253-
if ([request isKindOfClass:[BranchCloseRequest class]] || [request isKindOfClass:[BNCDebugRequest class]]) {
252+
if ([request isKindOfClass:[BranchCloseRequest class]]) {
254253
continue;
255254
}
256255

Branch-SDK/Branch-SDK/Branch.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,13 +1449,6 @@ typedef NS_ENUM(NSUInteger, BranchPromoCodeUsageType) {
14491449
*/
14501450
- (id)initWithInterface:(BNCServerInterface *)interface queue:(BNCServerRequestQueue *)queue cache:(BNCLinkCache *)cache preferenceHelper:(BNCPreferenceHelper *)preferenceHelper key:(NSString *)key;
14511451

1452-
/**
1453-
Method for logging a message to the Branch server, used when remote debugging is enabled.
1454-
1455-
@warning This is meant for use internally only (exposed for the sake of testing) and should not be used by apps.
1456-
*/
1457-
- (void)log:(NSString *)log;
1458-
14591452
/**
14601453
Method used by BranchUniversalObject to register a view on content
14611454

Branch-SDK/Branch-SDK/Branch.m

Lines changed: 1 addition & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535
#import "BranchCloseRequest.h"
3636
#import "BranchOpenRequest.h"
3737
#import "BranchInstallRequest.h"
38-
#import "BranchConnectDebugRequest.h"
39-
#import "BranchDisconnectDebugRequest.h"
40-
#import "BranchLogRequest.h"
4138
#import "BranchSpotlightUrlRequest.h"
4239
#import "BranchRegisterViewRequest.h"
4340

@@ -57,17 +54,12 @@
5754
NSString * const BRANCH_INIT_KEY_PHONE_NUMBER = @"+phone_number";
5855
NSString * const BRANCH_INIT_KEY_IS_FIRST_SESSION = @"+is_first_session";
5956
NSString * const BRANCH_INIT_KEY_CLICKED_BRANCH_LINK = @"+clicked_branch_link";
60-
6157
NSString * const BRANCH_PUSH_NOTIFICATION_PAYLOAD_KEY = @"branch";
6258

63-
static int BNCDebugTriggerDuration = 3;
64-
static int BNCDebugTriggerFingers = 4;
65-
static int BNCDebugTriggerFingersSimulator = 2;
59+
@interface Branch() <BranchDeepLinkingControllerCompletionDelegate>
6660

67-
@interface Branch() <UIGestureRecognizerDelegate, BranchDeepLinkingControllerCompletionDelegate>
6861

6962
@property (strong, nonatomic) BNCServerInterface *bServerInterface;
70-
7163
@property (strong, nonatomic) NSTimer *sessionTimer;
7264
@property (strong, nonatomic) BNCServerRequestQueue *requestQueue;
7365
@property (strong, nonatomic) dispatch_semaphore_t processing_sema;
@@ -267,7 +259,6 @@ - (void)accountForFacebookSDKPreventingAppLaunch {
267259
self.accountForFacebookSDK = YES;
268260
}
269261

270-
271262
#pragma mark - InitSession Permutation methods
272263

273264
- (void)initSession {
@@ -1051,14 +1042,6 @@ - (void)applyPromoCode:(NSString *)code useOld:(BOOL)useOld callback:(callbackWi
10511042
}
10521043

10531044

1054-
#pragma mark - Logging
1055-
- (void)log:(NSString *)log {
1056-
BranchLogRequest *request = [[BranchLogRequest alloc] initWithLog:log];
1057-
[self.requestQueue enqueue:request];
1058-
[self processNextQueueItem];
1059-
}
1060-
1061-
10621045
#pragma mark - Private methods
10631046

10641047
+ (Branch *)getInstanceInternal:(NSString *)key returnNilIfNoCurrentInstance:(BOOL)returnNilIfNoCurrentInstance {
@@ -1224,8 +1207,6 @@ - (void)applicationDidBecomeActive {
12241207
if (!self.isInitialized && !self.preferenceHelper.isContinuingUserActivity && ![self.requestQueue containsInstallOrOpen]) {
12251208
[self initUserSessionAndCallCallback:YES];
12261209
}
1227-
1228-
[self addDebugGestureRecognizer];
12291210
}
12301211

12311212
- (void)applicationWillResignActive {
@@ -1480,79 +1461,4 @@ - (void)deepLinkingControllerCompleted {
14801461
}
14811462

14821463

1483-
#pragma mark - Debugger functions
1484-
1485-
- (void)addDebugGestureRecognizer {
1486-
[self addGesterRecognizer:@selector(connectToDebug:)];
1487-
}
1488-
1489-
- (void)addCancelDebugGestureRecognizer {
1490-
[self addGesterRecognizer:@selector(endRemoteDebugging:)];
1491-
}
1492-
1493-
- (void)addGesterRecognizer:(SEL)action {
1494-
UIWindow *window = [UIApplication sharedApplication].keyWindow;
1495-
[window removeGestureRecognizer:self.debugGestureRecognizer]; // Remove existing gesture
1496-
1497-
self.debugGestureRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:action];
1498-
self.debugGestureRecognizer.delegate = self;
1499-
self.debugGestureRecognizer.minimumPressDuration = BNCDebugTriggerDuration;
1500-
1501-
if ([BNCSystemObserver isSimulator]) {
1502-
self.debugGestureRecognizer.numberOfTouchesRequired = BNCDebugTriggerFingersSimulator;
1503-
}
1504-
else {
1505-
self.debugGestureRecognizer.numberOfTouchesRequired = BNCDebugTriggerFingers;
1506-
}
1507-
1508-
[window addGestureRecognizer:self.debugGestureRecognizer];
1509-
}
1510-
1511-
- (void)connectToDebug:(UILongPressGestureRecognizer *)sender {
1512-
if (sender.state == UIGestureRecognizerStateBegan){
1513-
NSLog(@"======= Start Debug Session =======");
1514-
BranchConnectDebugRequest *request = [[BranchConnectDebugRequest alloc] initWithCallback:^(BOOL success, NSError *error) {
1515-
[self startRemoteDebugging];
1516-
}];
1517-
1518-
[self.requestQueue enqueue:request];
1519-
[self processNextQueueItem];
1520-
}
1521-
}
1522-
1523-
- (void)startRemoteDebugging {
1524-
NSLog(@"======= Connected to Branch Remote Debugger =======");
1525-
1526-
[[UIApplication sharedApplication].keyWindow removeGestureRecognizer:self.debugGestureRecognizer];
1527-
[self addCancelDebugGestureRecognizer];
1528-
1529-
//TODO: change to send screenshots instead in future
1530-
if (!self.debugHeartbeatTimer || !self.debugHeartbeatTimer.isValid) {
1531-
self.debugHeartbeatTimer = [NSTimer scheduledTimerWithTimeInterval:20 target:self selector:@selector(keepDebugAlive) userInfo:nil repeats:YES];
1532-
}
1533-
}
1534-
1535-
- (void)endRemoteDebugging:(UILongPressGestureRecognizer *)sender {
1536-
NSLog(@"======= End Debug Session =======");
1537-
1538-
[[UIApplication sharedApplication].keyWindow removeGestureRecognizer:sender];
1539-
BranchDisconnectDebugRequest *request = [[BranchDisconnectDebugRequest alloc] init];
1540-
[self.requestQueue enqueue:request];
1541-
[self processNextQueueItem];
1542-
1543-
[self.debugHeartbeatTimer invalidate];
1544-
[self addDebugGestureRecognizer];
1545-
}
1546-
1547-
- (void)keepDebugAlive {
1548-
NSLog(@"[Branch Debug] Sending Keep Alive");
1549-
[self log:@""];
1550-
}
1551-
1552-
#pragma mark - UIGestureRecognizerDelegate
1553-
1554-
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
1555-
return YES;
1556-
}
1557-
15581464
@end

Branch-SDK/Branch-SDK/Requests/BNCDebugRequest.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

Branch-SDK/Branch-SDK/Requests/BNCDebugRequest.m

Lines changed: 0 additions & 14 deletions
This file was deleted.

Branch-SDK/Branch-SDK/Requests/BranchConnectDebugRequest.h

Lines changed: 0 additions & 16 deletions
This file was deleted.

Branch-SDK/Branch-SDK/Requests/BranchConnectDebugRequest.m

Lines changed: 0 additions & 62 deletions
This file was deleted.

Branch-SDK/Branch-SDK/Requests/BranchDisconnectDebugRequest.h

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)