mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 21:33:12 +08:00 
			
		
		
		
	ensure reload
This commit is contained in:
		| @@ -315,17 +315,18 @@ RCT_EXPORT_METHOD(reloadUpdate:(NSDictionary *)options | |||||||
|         if (hash.length) { |         if (hash.length) { | ||||||
|             [self setNeedUpdate:options resolver:resolve rejecter:reject]; |             [self setNeedUpdate:options resolver:resolve rejecter:reject]; | ||||||
|              |              | ||||||
|             #if __has_include("RCTReloadCommand.h") |  | ||||||
|                 // reload 0.62+ |  | ||||||
|                 RCTReloadCommandSetBundleURL([[self class] bundleURL]); |  | ||||||
|                 RCTTriggerReloadCommandListeners(@"pushy reload"); |  | ||||||
|             #else |  | ||||||
|             // reload in earlier version |             // reload in earlier version | ||||||
|             dispatch_async(dispatch_get_main_queue(), ^{ |             dispatch_async(dispatch_get_main_queue(), ^{ | ||||||
|                 [self.bridge setValue:[[self class] bundleURL] forKey:@"bundleURL"]; |                 [self.bridge setValue:[[self class] bundleURL] forKey:@"bundleURL"]; | ||||||
|                 [self.bridge reload]; |                 [self.bridge reload]; | ||||||
|             }); |             }); | ||||||
|  |              | ||||||
|  |             #if __has_include("RCTReloadCommand.h") | ||||||
|  |                 // reload 0.62+ | ||||||
|  |                 RCTReloadCommandSetBundleURL([[self class] bundleURL]); | ||||||
|  |                 RCTTriggerReloadCommandListeners(@"pushy reload"); | ||||||
|             #endif |             #endif | ||||||
|  |  | ||||||
|             resolve(@true); |             resolve(@true); | ||||||
|         }else{ |         }else{ | ||||||
|             reject(@"执行报错", nil, nil); |             reject(@"执行报错", nil, nil); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 sunny.luo
					sunny.luo