Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 4bea684

Browse files
committed
Set isPending
1 parent 3086aea commit 4bea684

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ios/CodePush/CodePush.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ - (void)applicationWillResignActive
544544
{
545545
NSError *error;
546546
NSMutableDictionary *package = [[CodePushPackage getCurrentPackage:&error] mutableCopy];
547-
547+
548548
if (error) {
549549
return reject([NSString stringWithFormat: @"%lu", (long)error.code], error.localizedDescription, error);
550550
} else if (package == nil) {
@@ -570,13 +570,17 @@ - (void)applicationWillResignActive
570570
// 1) Caller wanted a pending, and there is a pending update
571571
// 2) Caller wanted the running update, and there isn't a pending
572572
// 3) Calers wants the latest update, regardless if it's pending or not
573+
573574
if (isRunningBinaryVersion) {
574575
// This only matters in Debug builds. Since we do not clear "outdated" updates,
575576
// we need to indicate to the JS side that somehow we have a current update on
576577
// disk that is not actually running.
577578
[package setObject:@(YES) forKey:@"_isDebugOnly"];
578579
}
579-
580+
581+
// To support differentiating pending vs. non-pending updates
582+
// when request an update state of LATEST, provide an isPending flag
583+
[package setObject:@(currentUpdateIsPending) forKey:PackageIsPendingKey];
580584
resolve(package);
581585
}
582586
}

0 commit comments

Comments
 (0)