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

Commit aa92913

Browse files
committed
package metadata
1 parent 077e9f4 commit aa92913

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

CodePush.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ + (NSURL *)bundleURLForResource:(NSString *)resourceName
6262
NSDate *binaryDate = [binaryFileAttributes objectForKey:NSFileModificationDate];
6363
NSDate *packageDate = [appFileAttribs objectForKey:NSFileModificationDate];
6464
NSString *binaryAppVersion = [[CodePushConfig current] appVersion];
65-
NSString *packageAppVersion = [appFileAttribs objectForKey:@"appVersion"];
65+
NSDictionary *currentPackageMetadata = [CodePushPackage getCurrentPackage:&error];
66+
if (error || !currentPackageMetadata) {
67+
NSLog(logMessageFormat, binaryJsBundleUrl);
68+
return binaryJsBundleUrl;
69+
}
70+
71+
NSString *packageAppVersion = [currentPackageMetadata objectForKey:@"appVersion"];
6672

6773
if ([binaryDate compare:packageDate] == NSOrderedAscending && [binaryAppVersion isEqualToString:packageAppVersion]) {
6874
// Return package file because it is newer than the app store binary's JS bundle

0 commit comments

Comments
 (0)