mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-10 15:49:36 +08:00
move to private
This commit is contained in:
28
CodePush.m
28
CodePush.m
@@ -119,20 +119,6 @@ static NSString *bundleResourceName = @"main";
|
||||
return testConfigurationFlag;
|
||||
}
|
||||
|
||||
/*
|
||||
* This returns the modified date as a string for a given file URL.
|
||||
*/
|
||||
+ (NSString *)modifiedDateStringOfFileAtUrl:(NSURL *)fileUrl
|
||||
{
|
||||
if (fileUrl != nil) {
|
||||
NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[fileUrl path] error:nil];
|
||||
NSDate *modifiedDate = [fileAttributes objectForKey:NSFileModificationDate];
|
||||
return [NSString stringWithFormat:@"%f", [modifiedDate timeIntervalSince1970]];
|
||||
} else {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)setDeploymentKey:(NSString *)deploymentKey
|
||||
{
|
||||
[CodePushConfig current].deploymentKey = deploymentKey;
|
||||
@@ -300,6 +286,20 @@ static NSString *bundleResourceName = @"main";
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* This returns the modified date as a string for a given file URL.
|
||||
*/
|
||||
+ (NSString *)modifiedDateStringOfFileAtURL:(NSURL *)fileURL
|
||||
{
|
||||
if (fileURL != nil) {
|
||||
NSDictionary *fileAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:[fileURL path] error:nil];
|
||||
NSDate *modifiedDate = [fileAttributes objectForKey:NSFileModificationDate];
|
||||
return [NSString stringWithFormat:@"%f", [modifiedDate timeIntervalSince1970]];
|
||||
} else {
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This method is used when an update has failed installation
|
||||
* and the app needs to be rolled back to the previous bundle.
|
||||
|
||||
Reference in New Issue
Block a user