mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-13 17:45:34 +08:00
feedback
This commit is contained in:
10
CodePush.m
10
CodePush.m
@@ -57,9 +57,7 @@ static NSString *const PackageIsPendingKey = @"isPending";
|
||||
NSError *error;
|
||||
NSString *packageFile = [CodePushPackage getCurrentPackageBundlePath:&error];
|
||||
NSURL *binaryJsBundleUrl = [[NSBundle mainBundle] URLForResource:resourceName withExtension:resourceExtension];
|
||||
NSDictionary *binaryFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[binaryJsBundleUrl path] error:nil];
|
||||
NSDate *binaryDate = [binaryFileAttributes objectForKey:NSFileModificationDate];
|
||||
[self saveBinaryBundleDate:binaryDate];
|
||||
[self saveBinaryBundleDate:binaryJsBundleUrl];
|
||||
|
||||
NSString *logMessageFormat = @"Loading JS bundle from %@";
|
||||
|
||||
@@ -124,10 +122,12 @@ static NSString *const PackageIsPendingKey = @"isPending";
|
||||
return testConfigurationFlag;
|
||||
}
|
||||
|
||||
+ (void)saveBinaryBundleDate:(NSDate *)binaryBundleDate
|
||||
+ (void)saveBinaryBundleDate:(NSURL *)binaryJsBundleUrl
|
||||
{
|
||||
NSDictionary *binaryFileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[binaryJsBundleUrl path] error:nil];
|
||||
NSDate *binaryDate = [binaryFileAttributes objectForKey:NSFileModificationDate];
|
||||
NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
|
||||
[preferences setObject:binaryBundleDate forKey:BinaryBundleDateKey];
|
||||
[preferences setObject:binaryDate forKey:BinaryBundleDateKey];
|
||||
[preferences synchronize];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user