Skip to content

Commit f0fe291

Browse files
Merge pull request #41 from mendix/MOO-2374-fix-ios-ota-loop
[MOO-2374] Fix iOS OTA loop
2 parents 9de19c6 + a354fa2 commit f0fe291

3 files changed

Lines changed: 29 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11+
- We fixed an issue that could cause iOS apps to restart repeatedly after an OTA update.
12+
13+
## [v0.3.3] - 2026-06-03
14+
15+
- We fixed an issue that could cause Android apps to restart repeatedly after an OTA update.
16+
17+
## [v0.3.2] - Skip
18+
19+
## [v0.3.1] - 2026-01-08
20+
1121
- We added `SessionCookieStore` to persist, restore and clear session cookies on iOS.
1222

1323
## [v0.3.0] - 2025-12-09

ios/Modules/ReactNative.swift

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,11 @@ open class ReactNative: NSObject, RCTReloadListener {
8181
// MARK: - Reload Methods
8282
public func reload() {
8383
guard let mendixApp = mendixApp else { return }
84-
85-
let otaBundleUrl = OtaJSBundleFileProvider.getBundleUrl()
86-
if !mendixApp.isDeveloperApp, let otaBundleUrl = otaBundleUrl {
87-
RCTReloadCommandSetBundleURL(otaBundleUrl)
88-
}
89-
84+
85+
// Note: under the New Architecture the bundle URL is resolved fresh in bundleURL(),
86+
// which RCTHost re-invokes on reload. RCTReloadCommandSetBundleURL is a legacy-bridge
87+
// mechanism that the bridgeless host ignores, so it is intentionally not used here.
88+
9089
if mendixApp.isDeveloperApp {
9190
let runtimeInfoUrl = AppUrl.forRuntimeInfo(mendixApp.runtimeUrl.absoluteString)
9291
RuntimeInfoProvider.getRuntimeInfo(runtimeInfoUrl) { [weak self] response in
@@ -153,7 +152,19 @@ open class ReactNative: NSObject, RCTReloadListener {
153152
}
154153

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mendix-native",
3-
"version": "0.3.2",
3+
"version": "0.3.3",
44
"description": "Mendix native mobile package",
55
"main": "./lib/module/index.js",
66
"types": "./lib/typescript/src/index.d.ts",

0 commit comments

Comments
 (0)