framepayments-react-native 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -192,15 +192,26 @@ public class FrameSDKBridge: NSObject {
192
192
  }
193
193
  )
194
194
  )
195
- hosting.modalPresentationStyle = UIModalPresentationStyle.pageSheet
196
- if let sheet = hosting.sheetPresentationController {
195
+ // Embed in a UINavigationController so the outer sheet is a UIKit container,
196
+ // not a SwiftUI-bridged one. On iOS 18, presenting the UIHostingController
197
+ // directly causes SwiftUI's SheetBridge to call dismiss on the host whenever
198
+ // a nested .sheet() inside the onboarding flow toggles its binding (its
199
+ // preferencesDidChange propagates up to the outer bridge). The nav
200
+ // controller breaks that propagation. Nav bar is hidden so the sheet looks
201
+ // identical to before.
202
+ let nav = UINavigationController(rootViewController: hosting)
203
+ nav.setNavigationBarHidden(true, animated: false)
204
+ nav.modalPresentationStyle = UIModalPresentationStyle.pageSheet
205
+ if let sheet = nav.sheetPresentationController {
197
206
  sheet.detents = [UISheetPresentationController.Detent.large()]
198
207
  }
199
208
  delegate = OnboardingDismissDelegate(resolve: resolve)
200
- delegate.hostingController = hosting
201
- objc_setAssociatedObject(hosting, &onboardingDismissKey, delegate, .OBJC_ASSOCIATION_RETAIN)
202
- top.present(hosting, animated: true) {
203
- hosting.presentationController?.delegate = delegate
209
+ delegate.hostingController = nav
210
+ objc_setAssociatedObject(nav, &onboardingDismissKey, delegate, .OBJC_ASSOCIATION_RETAIN)
211
+ NSLog("[FrameRN][onb] presenting OnboardingHostingController (wrapped in UINavigationController) from \(type(of: top))")
212
+ top.present(nav, animated: true) {
213
+ nav.presentationController?.delegate = delegate
214
+ NSLog("[FrameRN][onb] presentation completed; presentationController=\(String(describing: nav.presentationController)) delegate set")
204
215
  }
205
216
  }
206
217
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framepayments-react-native",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "React Native SDK for Frame Payments - modal checkout and cart, with API usage via frame-node.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",