Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- We fixed an issue that could cause iOS apps to restart repeatedly after an OTA update.

## [v0.5.0] - 2026-05-15

- We updated to React Native v0.84.1 and replaced deprecated APIs with modern equivalents.
Expand Down
25 changes: 18 additions & 7 deletions ios/Modules/ReactNative.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,11 @@ open class ReactNative: NSObject, RCTReloadListener {
// MARK: - Reload Methods
public func reload() {
guard let mendixApp = mendixApp else { return }

let otaBundleUrl = OtaJSBundleFileProvider.getBundleUrl()
if !mendixApp.isDeveloperApp, let otaBundleUrl = otaBundleUrl {
RCTReloadCommandSetBundleURL(otaBundleUrl)
}


// Note: under the New Architecture the bundle URL is resolved fresh in bundleURL(),
// which RCTHost re-invokes on reload. RCTReloadCommandSetBundleURL is a legacy-bridge
// mechanism that the bridgeless host ignores, so it is intentionally not used here.

if mendixApp.isDeveloperApp {
let runtimeInfoUrl = AppUrl.forRuntimeInfo(mendixApp.runtimeUrl.absoluteString)
RuntimeInfoProvider.getRuntimeInfo(runtimeInfoUrl) { [weak self] response in
Expand Down Expand Up @@ -153,7 +152,19 @@ open class ReactNative: NSObject, RCTReloadListener {
}

public func bundleURL() -> URL? {
return bundleUrl
// New Architecture (Bridgeless): RCTHost re-invokes this provider block on every
// reload (via RCTRootViewFactory's bundleURLBlock) instead of consulting the URL set
// by RCTReloadCommandSetBundleURL. Resolve the OTA bundle fresh here so a freshly
// deployed OTA bundle is picked up after reload. Without this, every reload re-loads
// the bundle captured at host-creation time and the app loops:
// download -> deploy -> reload -> same bundle.
//
// For the developer app (and remote debugging) the cached packager URL must be used,
// so only the production path re-resolves through BundleHelper.
if mendixApp?.isDeveloperApp == true {
return bundleUrl
}
return BundleHelper.getJSBundleFile()
}
}

Loading