Skip to content

Commit 239b3f0

Browse files
authored
Removed background parameter and checks. (#385)
1 parent 08d8a0f commit 239b3f0

File tree

3 files changed

+11
-35
lines changed

3 files changed

+11
-35
lines changed

Leanplum-SDK/Classes/Internal/LPConstants.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ OBJC_EXPORT NSString *LP_PARAM_LIMIT_TRACKING;
195195
OBJC_EXPORT NSString *LP_PARAM_MESSAGE;
196196
OBJC_EXPORT NSString *LP_PARAM_NAME;
197197
OBJC_EXPORT NSString *LP_PARAM_MESSAGE_ID;
198-
OBJC_EXPORT NSString *LP_PARAM_BACKGROUND;
199198
OBJC_EXPORT NSString *LP_PARAM_INSTALL_DATE;
200199
OBJC_EXPORT NSString *LP_PARAM_UPDATE_DATE;
201200
OBJC_EXPORT NSString *LP_PARAM_INBOX_MESSAGES;

Leanplum-SDK/Classes/Internal/LPConstants.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ - (id)init {
146146
NSString *LP_PARAM_NAME = @"name";
147147
NSString *LP_PARAM_MESSAGE = @"message";
148148
NSString *LP_PARAM_MESSAGE_ID = @"messageId";
149-
NSString *LP_PARAM_BACKGROUND = @"background";
150149
NSString *LP_PARAM_INBOX_MESSAGES = @"newsfeedMessages";
151150
NSString *LP_PARAM_INBOX_MESSAGE_ID = @"newsfeedMessageId";
152151
NSString *LP_PARAM_RICH_PUSH_ENABLED = @"richPushEnabled";

Leanplum-SDK/Classes/Internal/Leanplum.m

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ - (void)leanplum_cancelRequestWithError:(NSError *)error
7979

8080
void leanplumExceptionHandler(NSException *exception);
8181

82-
BOOL inForeground = NO;
83-
8482
@implementation Leanplum
8583

8684
+ (void)throwError:(NSString *)reason
@@ -808,13 +806,6 @@ + (void)startWithUserId:(NSString *)userId
808806
params[LP_PARAM_INCLUDE_VARIANT_DEBUG_INFO] = @(YES);
809807
}
810808

811-
BOOL startedInBackground = NO;
812-
if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground &&
813-
!_extensionContext) {
814-
params[LP_PARAM_BACKGROUND] = @(YES);
815-
startedInBackground = YES;
816-
}
817-
818809
if (attributes != nil) {
819810
params[LP_PARAM_USER_ATTRIBUTES] = attributes ?
820811
[LPJSON stringFromJSON:attributes] : @"";
@@ -934,15 +925,12 @@ + (void)startWithUserId:(NSString *)userId
934925
// Upload alternative app icons.
935926
[LPAppIconManager uploadAppIconsOnDevMode];
936927

937-
if (!startedInBackground) {
938-
inForeground = YES;
939-
[self maybePerformActions:@[@"start", @"resume"]
940-
withEventName:nil
941-
withFilter:kLeanplumActionFilterAll
942-
fromMessageId:nil
943-
withContextualValues:nil];
944-
[self recordAttributeChanges];
945-
}
928+
[self maybePerformActions:@[@"start", @"resume"]
929+
withEventName:nil
930+
withFilter:kLeanplumActionFilterAll
931+
fromMessageId:nil
932+
withContextualValues:nil];
933+
[self recordAttributeChanges];
946934
LP_END_TRY
947935
}];
948936
[request onError:^(NSError *err) {
@@ -989,21 +977,11 @@ + (void)startWithUserId:(NSString *)userId
989977
currentUserNotificationSettings]];
990978
}
991979
[Leanplum resume];
992-
if (startedInBackground && !inForeground) {
993-
inForeground = YES;
994-
[self maybePerformActions:@[@"start", @"resume"]
995-
withEventName:nil
996-
withFilter:kLeanplumActionFilterAll
997-
fromMessageId:nil
998-
withContextualValues:nil];
999-
[self recordAttributeChanges];
1000-
} else {
1001-
[self maybePerformActions:@[@"resume"]
1002-
withEventName:nil
1003-
withFilter:kLeanplumActionFilterAll
1004-
fromMessageId:nil
1005-
withContextualValues:nil];
1006-
}
980+
[self maybePerformActions:@[@"resume"]
981+
withEventName:nil
982+
withFilter:kLeanplumActionFilterAll
983+
fromMessageId:nil
984+
withContextualValues:nil];
1007985
LP_END_TRY
1008986
}];
1009987

0 commit comments

Comments
 (0)