Skip to content

Commit 8a65fce

Browse files
authored
Remove dead code (#455)
1 parent cf473db commit 8a65fce

File tree

7 files changed

+16
-131
lines changed

7 files changed

+16
-131
lines changed

LeanplumSDK/LeanplumSDK/Classes/Internal/LPConstants.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,10 @@ NS_SWIFT_NAME(Leanplum.Constants)
7878
int _networkTimeoutSeconds;
7979
int _networkTimeoutSecondsForDownloads;
8080
int _syncNetworkTimeoutSeconds;
81-
BOOL _checkForUpdatesInDevelopmentMode;
8281
BOOL _isDevelopmentModeEnabled;
8382
BOOL _loggingEnabled;
84-
BOOL _canDownloadContentMidSessionInProduction;
8583
BOOL _isTestMode;
8684
BOOL _isInPermanentFailureState;
87-
BOOL _networkActivityIndicatorEnabled;
8885
NSString *_client;
8986
NSString *_sdkVersion;
9087
// Counts how many user code blocks we're inside, to silence exceptions.
@@ -99,16 +96,13 @@ NS_SWIFT_NAME(Leanplum.Constants)
9996
@property(assign, nonatomic) int networkTimeoutSeconds;
10097
@property(assign, nonatomic) int networkTimeoutSecondsForDownloads;
10198
@property(assign, nonatomic) int syncNetworkTimeoutSeconds;
102-
@property(assign, nonatomic) BOOL checkForUpdatesInDevelopmentMode;
10399
@property(assign, nonatomic) BOOL isDevelopmentModeEnabled;
104100
@property(assign, nonatomic) BOOL loggingEnabled;
105-
@property(assign, nonatomic) BOOL canDownloadContentMidSessionInProduction;
106101
@property(strong, nonatomic) NSString *apiServlet;
107102
@property(assign, nonatomic) BOOL isTestMode;
108103
@property(assign, nonatomic) BOOL isInPermanentFailureState;
109104
@property(strong, nonatomic) NSString *client;
110105
@property(strong, nonatomic) NSString *sdkVersion;
111-
@property(assign, nonatomic) BOOL networkActivityIndicatorEnabled;
112106
@property(assign, nonatomic) BOOL isLocationCollectionEnabled;
113107
@property(assign, nonatomic) BOOL isInboxImagePrefetchingEnabled;
114108

LeanplumSDK/LeanplumSDK/Classes/Internal/LPConstants.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,10 @@ - (id)init {
4848
_networkTimeoutSeconds = 10;
4949
_networkTimeoutSecondsForDownloads = 15;
5050
_syncNetworkTimeoutSeconds = 5;
51-
_checkForUpdatesInDevelopmentMode = YES;
5251
_isDevelopmentModeEnabled = NO;
5352
_loggingEnabled = NO;
54-
_canDownloadContentMidSessionInProduction = NO;
5553
_isTestMode = NO;
5654
_isInPermanentFailureState = NO;
57-
_networkActivityIndicatorEnabled = YES;
5855
_client = LEANPLUM_CLIENT;
5956
_sdkVersion = LEANPLUM_SDK_VERSION;
6057
_isLocationCollectionEnabled = YES;

LeanplumSDK/LeanplumSDK/Classes/Internal/LPInternalState.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616
@property(strong, nonatomic) NSMutableSet *startResponders, *variablesChangedResponders, *noDownloadsResponders;
1717
@property(assign, nonatomic) NSUncaughtExceptionHandler *customExceptionHandler;
1818
@property(strong, nonatomic) LPRegisterDevice *registration;
19-
@property(assign, nonatomic) BOOL calledStart, hasStarted, hasStartedAndRegisteredAsDeveloper, startSuccessful, issuedStart, stripViewControllerFromState;
19+
@property(assign, nonatomic) BOOL calledStart, hasStarted, hasStartedAndRegisteredAsDeveloper, startSuccessful, issuedStart;
2020
@property(strong, nonatomic) LPActionManager *actionManager;
2121
@property(strong, nonatomic) NSString *appVersion;
2222
@property(strong, nonatomic) NSMutableArray *userAttributeChanges;
23-
@property(assign, nonatomic) BOOL isScreenTrackingEnabled;
2423
@property(assign, nonatomic) BOOL isVariantDebugInfoEnabled;
2524
@property(assign, nonatomic) BOOL calledHandleNotification;
2625

LeanplumSDK/LeanplumSDK/Classes/Internal/LPInternalState.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ - (id)init {
3838
_startSuccessful = NO;
3939
_actionManager = nil;
4040
_userAttributeChanges = [NSMutableArray array];
41-
_stripViewControllerFromState = NO;
42-
_isScreenTrackingEnabled = NO;
4341
_calledHandleNotification = NO;
4442
}
4543
return self;

LeanplumSDK/LeanplumSDK/Classes/Internal/Leanplum.m

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,6 @@ + (void)setClient:(NSString *)client withVersion:(NSString *)version
170170
[LPConstantsState sharedState].sdkVersion = version;
171171
}
172172

173-
+ (void)setFileHashingEnabledInDevelopmentMode:(BOOL)enabled
174-
{
175-
LP_TRY
176-
[LPConstantsState sharedState].checkForUpdatesInDevelopmentMode = enabled;
177-
LP_END_TRY
178-
}
179-
180173
+ (void)setLogLevel:(LPLogLevel)level
181174
{
182175
LP_TRY
@@ -217,20 +210,6 @@ + (void)setNetworkTimeoutSeconds:(int)seconds forDownloads:(int)downloadSeconds
217210
LP_END_TRY
218211
}
219212

220-
+ (void)setNetworkActivityIndicatorEnabled:(BOOL)enabled
221-
{
222-
LP_TRY
223-
[LPConstantsState sharedState].networkActivityIndicatorEnabled = enabled;
224-
LP_END_TRY
225-
}
226-
227-
+ (void)setCanDownloadContentMidSessionInProductionMode:(BOOL)value
228-
{
229-
LP_TRY
230-
[LPConstantsState sharedState].canDownloadContentMidSessionInProduction = value;
231-
LP_END_TRY
232-
}
233-
234213
+ (BOOL)isRichPushEnabled
235214
{
236215
NSString *plugInsPath = [NSBundle mainBundle].builtInPlugInsPath;
@@ -1938,21 +1917,6 @@ + (void)setVariantDebugInfoEnabled:(BOOL)variantDebugInfoEnabled
19381917
[[LPCountAggregator sharedAggregator] incrementCount:@"set_variant_debug_info_enabled"];
19391918
}
19401919

1941-
+ (void)trackAllAppScreens
1942-
{
1943-
[Leanplum trackAllAppScreensWithMode:LPTrackScreenModeDefault];
1944-
}
1945-
1946-
+ (void)trackAllAppScreensWithMode:(LPTrackScreenMode)trackScreenMode;
1947-
{
1948-
RETURN_IF_NOOP;
1949-
1950-
LP_TRY
1951-
BOOL stripViewControllerFromState = trackScreenMode == LPTrackScreenModeStripViewController;
1952-
[[LPInternalState sharedState] setStripViewControllerFromState:stripViewControllerFromState];
1953-
LP_END_TRY
1954-
}
1955-
19561920
+ (void)trackPurchase:(NSString *)event withValue:(double)value
19571921
andCurrencyCode:(NSString *)currencyCode andParameters:(NSDictionary *)params
19581922
{
@@ -2308,11 +2272,6 @@ + (void)advanceTo:(NSString *)state withInfo:(NSString *)info andParameters:(NSD
23082272
return;
23092273
}
23102274
LP_TRY
2311-
if (state &&
2312-
[[LPInternalState sharedState] stripViewControllerFromState] &&
2313-
[state hasSuffix:@"ViewController"]) {
2314-
state = [state substringToIndex:([state length] - [@"ViewController" length])];
2315-
}
23162275
NSMutableDictionary *args = [NSMutableDictionary dictionaryWithObjectsAndKeys:
23172276
state ? state : @"", LP_PARAM_STATE, nil];
23182277
if (info) {

LeanplumSDK/LeanplumSDK/Classes/Leanplum.h

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -203,28 +203,6 @@ NS_SWIFT_NAME(setSocketHostName(_:port:));
203203
+ (void)setNetworkTimeoutSeconds:(int)seconds forDownloads:(int)downloadSeconds;
204204
/**@}*/
205205

206-
/**
207-
* Sets whether to show the network activity indicator in the status bar when making requests.
208-
* Default: YES.
209-
*/
210-
+ (void)setNetworkActivityIndicatorEnabled:(BOOL)enabled;
211-
212-
/**
213-
* Advanced: Whether new variables can be downloaded mid-session. By default, this is disabled.
214-
* Currently, if this is enabled, new variables can only be downloaded if a push notification is sent
215-
* while the app is running, and the notification's metadata hasn't be downloaded yet.
216-
*/
217-
+ (void)setCanDownloadContentMidSessionInProductionMode:(BOOL)value;
218-
219-
/**
220-
* Modifies the file hashing setting in development mode.
221-
* By default, Leanplum will hash file variables to determine if they're modified and need
222-
* to be uploaded to the server if we're running in the simulator.
223-
* Setting this to NO will reduce startup latency in development mode, but it's possible
224-
* that Leanplum will not always have the most up-to-date versions of your resources.
225-
*/
226-
+ (void)setFileHashingEnabledInDevelopmentMode:(BOOL)enabled;
227-
228206
/**
229207
* Sets log level through the Leanplum SDK
230208
*/
@@ -611,34 +589,6 @@ NS_SWIFT_NAME(advance(state:info:params:));
611589
*/
612590
+ (void)resumeState;
613591

614-
/**
615-
* Automatically tracks all of the screens in the app as states.
616-
* You should not use this in conjunction with advanceTo as the user can only be in
617-
* 1 state at a time. This method requires LeanplumUIEditor module.
618-
*/
619-
+ (void)trackAllAppScreens
620-
NS_SWIFT_NAME(trackAppScreens());
621-
622-
/**
623-
* LPTrackScreenMode enum.
624-
* LPTrackScreenModeDefault mans that states are the full view controller type name.
625-
* LPTrackScreenModeStripViewController will cause the string "ViewController" to be stripped from
626-
* the end of the state.
627-
*/
628-
typedef NS_ENUM(NSUInteger, LPTrackScreenMode) {
629-
LPTrackScreenModeDefault NS_SWIFT_NAME(defaultMode) = 0,
630-
LPTrackScreenModeStripViewController NS_SWIFT_NAME(stripMode)
631-
} NS_SWIFT_NAME(Leanplum.TrackScreenMode);
632-
633-
/**
634-
* Automatically tracks all of the screens in the app as states.
635-
* You should not use this in conjunction with advanceTo as the user can only be in
636-
* 1 state at a time. This method requires LeanplumUIEditor module.
637-
* @param trackScreenMode Choose mode for display. Default is the view controller type name.
638-
*/
639-
+ (void)trackAllAppScreensWithMode:(LPTrackScreenMode)trackScreenMode
640-
NS_SWIFT_NAME(trackAppScreens(mode:));
641-
642592
/**
643593
* Manually track purchase event with currency code in your application. It is advised to use
644594
* trackInAppPurchases to automatically track IAPs.
@@ -756,8 +706,10 @@ NS_SWIFT_UNAVAILABLE("use forceContentUpdate(completion:)");
756706
/**
757707
* This should be your first statement in a unit test. This prevents
758708
* Leanplum from communicating with the server.
709+
* Deprecated. Use [Leanplum setTestModeEnabled:YES] instead.
759710
*/
760-
+ (void)enableTestMode;
711+
+ (void)enableTestMode
712+
__attribute__((deprecated("Use [Leanplum setTestModeEnabled:YES] instead.")));
761713

762714
/**
763715
* Used to enable or disable test mode. Test mode prevents Leanplum from

LeanplumSDK/LeanplumSDK/Classes/Notifications/Push/LPPushNotificationsHandler.m

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ - (void)requireMessageContent:(NSString *)messageId
354354
LP_PARAM_INCLUDE_DEFAULTS: @(NO),
355355
LP_PARAM_INCLUDE_MESSAGE_ID: messageId
356356
}]
357-
andRequestType:Immediate];
357+
andRequestType:Immediate];
358358
[request onResponse:^(id<LPNetworkOperationProtocol> operation, NSDictionary *response) {
359359
LP_TRY
360360
NSDictionary *values = response[LP_KEY_VARS];
@@ -365,33 +365,19 @@ - (void)requireMessageContent:(NSString *)messageId
365365
NSString *varsSignature = response[LP_KEY_VARS_SIGNATURE];
366366
NSArray *localCaps = response[LP_KEY_LOCAL_CAPS];
367367

368-
if (![LPConstantsState sharedState].canDownloadContentMidSessionInProduction ||
369-
[values isEqualToDictionary:[LPVarCache sharedCache].diffs]) {
370-
values = nil;
371-
varsJson = nil;
372-
varsSignature = nil;
373-
}
374-
if ([messages isEqualToDictionary:[LPVarCache sharedCache].messageDiffs]) {
375-
messages = nil;
376-
}
377-
if ([regions isEqualToDictionary:[LPVarCache sharedCache].regions]) {
378-
regions = nil;
379-
}
380-
if (values || messages || regions) {
381-
[[LPVarCache sharedCache] applyVariableDiffs:values
382-
messages:messages
383-
variants:variants
384-
localCaps:localCaps
385-
regions:regions
386-
variantDebugInfo:nil
387-
varsJson:varsJson
388-
varsSignature:varsSignature];
389-
if (onCompleted) {
390-
onCompleted();
391-
}
368+
[[LPVarCache sharedCache] applyVariableDiffs:values
369+
messages:messages
370+
variants:variants
371+
localCaps:localCaps
372+
regions:regions
373+
variantDebugInfo:nil
374+
varsJson:varsJson
375+
varsSignature:varsSignature];
376+
if (onCompleted) {
377+
onCompleted();
392378
}
393379
LP_END_TRY
394-
}];
380+
}];
395381
[[LPRequestSender sharedInstance] send:request];
396382
}
397383
LP_BEGIN_USER_CODE

0 commit comments

Comments
 (0)