Skip to content

Commit

Permalink
update bundleurl
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnylqm committed Sep 5, 2024
1 parent c4fe8db commit 1e104d5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion site/pages/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,19 @@ date +%s > "$DEST/pushy_build_time.txt"
// #endif


// 修改sourceURLForBridge方法
// rn 版本 >= 0.74 需要修改 bundleURL 方法
- (NSURL *)bundleURL
{
#if DEBUG
// 原先DEBUG这里的写法不作修改(所以DEBUG模式下不可热更新)
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
return [RCTPushy bundleURL]; // <-- 把这里非DEBUG的情况替换为热更新bundle
#endif
}


// rn 版本 < 0.74 需要修改sourceURLForBridge方法
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
Expand Down

0 comments on commit 1e104d5

Please sign in to comment.