@@ -79,8 +79,6 @@ - (void)leanplum_cancelRequestWithError:(NSError *)error
7979
8080void 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