Skip to content

Commit 73cf9cc

Browse files
author
sunny.luo
committed
ensure reload
1 parent ab22e7f commit 73cf9cc

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ios/RCTPushy/RCTPushy.mm

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,17 +315,18 @@ - (instancetype)init
315315
if (hash.length) {
316316
[self setNeedUpdate:options resolver:resolve rejecter:reject];
317317

318+
// reload in earlier version
319+
dispatch_async(dispatch_get_main_queue(), ^{
320+
[self.bridge setValue:[[self class] bundleURL] forKey:@"bundleURL"];
321+
[self.bridge reload];
322+
});
323+
318324
#if __has_include("RCTReloadCommand.h")
319325
// reload 0.62+
320326
RCTReloadCommandSetBundleURL([[self class] bundleURL]);
321327
RCTTriggerReloadCommandListeners(@"pushy reload");
322-
#else
323-
// reload in earlier version
324-
dispatch_async(dispatch_get_main_queue(), ^{
325-
[self.bridge setValue:[[self class] bundleURL] forKey:@"bundleURL"];
326-
[self.bridge reload];
327-
});
328328
#endif
329+
329330
resolve(@true);
330331
}else{
331332
reject(@"执行报错", nil, nil);

0 commit comments

Comments
 (0)