feat: expose native configuration and check-and-update APIs on all platforms - #641
Merged
Merged
Conversation
Contributor
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (23)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
Author
|
已合并并发布 react-native-update v10.57.0。
使用原生新接口仍需重新构建并分发原生安装包,不能仅靠 JS 热更新启用。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose a complete native-host entry path on Android, iOS and HarmonyOS: configure without JS → normal launch bundle resolution → check and download. Native configuration no longer depends on a successful previous JS startup.
Companion user documentation: reactnativecn/pushy-site#38
Public APIs
PushyNativeUpdate.configure(Context, JSONObject, ConfigurationCallback)andcheckAndUpdate(Context, Callback). Both callbacks are delivered on the main thread; configuration returns a nullable error.+[RCTPushy configure:completion:]and+[RCTPushy checkAndUpdateWithCompletion:]; Swift names areconfigure(_:completion:)andcheckAndUpdate(completion:). Completions use the main queue.PushyFileJSBundleProvider.configure(NativeUpdateConfig): Promise<void>andcheckAndUpdate(): Promise<NativeUpdateResult>; config/result types are exported from the HAR.Configuration contract
appKeyis required. Support optional endpoints, discovery URLs, afterDownload, disabled, packageVersion, and RN/SDK diagnostic version strings.none; choosesetNeedUpdateto select normal downloads for the next launch.nativeConfigSource: 'native'from initial JS construction stops constructor/setOptions synchronization from overwriting the host's configuration. It does not automatically mirror config into JS or disable JS checks.Check contract
Start the native round now, share an in-flight round, or reuse its settled result. Preserve at most one real round per process, including failed rounds. Reconfiguration does not create another round after one has already run.
Results distinguish skipped/noUpdate/downloaded/failed/cancelled.
activatedmeans selected for the next launch, not an immediate reload. Reuse existing C++ decisions, download fallback/integrity checks, rollback guards and crash rescue. Public waiters do not consume the crash-rescue semaphore signal.Verification
At commit
11de3d4499539a471018e381c85006ed591ee69e:Temporary source-preparation helpers and workflows have been removed from the final diff. No package has been published and no physical-device validation is claimed. Consumers must rebuild the native app and, for source-based Harmony integration, the HAR.
Summary by CodeRabbit
New Features
nativeConfigSourceto choose whether JavaScript or native hosts manage configuration.Bug Fixes