1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 08:41:37 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Back compatibility

This commit is contained in:
sunnylqm
2020-12-18 11:16:49 +08:00
parent 5786bf8132
commit 684dc8267d
2 changed files with 31 additions and 10 deletions

View File

@@ -256,6 +256,9 @@ RCT_EXPORT_METHOD(downloadPatchFromPpk:(NSDictionary *)options
RCT_EXPORT_METHOD(setNeedUpdate:(NSDictionary *)options)
{
NSString *hash = options[@"hash"];
if (hash.length <= 0) {
hash = options[@"hashName"];
}
if (hash.length) {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *lastVersion = nil;
@@ -279,6 +282,9 @@ RCT_EXPORT_METHOD(setNeedUpdate:(NSDictionary *)options)
RCT_EXPORT_METHOD(reloadUpdate:(NSDictionary *)options)
{
NSString *hash = options[@"hash"];
if (hash.length <= 0) {
hash = options[@"hashName"];
}
if (hash.length) {
[self setNeedUpdate:options];
@@ -335,6 +341,9 @@ RCT_EXPORT_METHOD(markSuccess)
{
NSString *updateUrl = [RCTConvert NSString:options[@"updateUrl"]];
NSString *hash = [RCTConvert NSString:options[@"hash"]];
if (hash.length <= 0) {
hash = [RCTConvert NSString:options[@"hashName"]];;
}
if (updateUrl.length <= 0 || hash.length <= 0) {
callback([self errorWithMessage:ERROR_OPTIONS]);
return;