framepayments-react-native 2.0.2 → 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.
@@ -1,8 +1,8 @@
1
- arguments=--init-script /var/folders/my/2knngz1131q4pq8rnxxjb3_h0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/my/2knngz1131q4pq8rnxxjb3_h0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle --init-script /var/folders/my/2knngz1131q4pq8rnxxjb3_h0000gn/T/861a75667e10803d304a058d833cb7404195ca44013d0d61d3b653eb084379b8.gradle --init-script /var/folders/my/2knngz1131q4pq8rnxxjb3_h0000gn/T/68eb1b6516fe21c6fbba58e63c99c3207ccfc918360613709367eecde56fa77f.gradle
2
- auto.sync=false
1
+ arguments=--init-script /var/folders/my/2knngz1131q4pq8rnxxjb3_h0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/my/2knngz1131q4pq8rnxxjb3_h0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle --init-script /var/folders/my/2knngz1131q4pq8rnxxjb3_h0000gn/T/861a75667e10803d304a058d833cb7404195ca44013d0d61d3b653eb084379b8.gradle --init-script /var/folders/my/2knngz1131q4pq8rnxxjb3_h0000gn/T/68eb1b6516fe21c6fbba58e63c99c3207ccfc918360613709367eecde56fa77f.gradle --init-script /var/folders/my/2knngz1131q4pq8rnxxjb3_h0000gn/T/da64152279c70a8b4f3de4ca9ea66fd3b3405b7aca4e1f20f2d08e5593aa1ce1.gradle
2
+ auto.sync=true
3
3
  build.scans.enabled=false
4
4
  connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.9))
5
- connection.project.dir=../../../android
5
+ connection.project.dir=
6
6
  eclipse.preferences.version=1
7
7
  gradle.user.home=
8
8
  java.home=/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home
@@ -1 +1 @@
1
- #Thu Apr 30 13:46:59 PDT 2026
1
+ #Fri May 01 16:00:34 PDT 2026
@@ -186,20 +186,32 @@ public class FrameSDKBridge: NSObject {
186
186
  rootView: OnboardingContainerView(
187
187
  accountId: accountId,
188
188
  requiredCapabilities: capabilities,
189
- onComplete: { [weak top] in
189
+ onComplete: { [weak hosting] in
190
190
  delegate?.finish(completed: true)
191
- top?.dismiss(animated: true)
191
+ hosting?.dismiss(animated: true)
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
- objc_setAssociatedObject(hosting, &onboardingDismissKey, delegate, .OBJC_ASSOCIATION_RETAIN)
201
- top.present(hosting, animated: true) {
202
- 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")
203
215
  }
204
216
  }
205
217
  }
@@ -245,6 +257,7 @@ private final class CartDismissDelegate: NSObject, UIAdaptivePresentationControl
245
257
 
246
258
  private final class OnboardingDismissDelegate: NSObject, UIAdaptivePresentationControllerDelegate {
247
259
  let resolve: RCTPromiseResolveBlock
260
+ weak var hostingController: UIViewController?
248
261
  var didFinish = false
249
262
 
250
263
  init(resolve: @escaping RCTPromiseResolveBlock) {
@@ -260,6 +273,10 @@ private final class OnboardingDismissDelegate: NSObject, UIAdaptivePresentationC
260
273
  }
261
274
 
262
275
  func presentationControllerDidDismiss(_ presentationController: UIPresentationController) {
276
+ // Nested SwiftUI sheets (e.g. the phone country picker) propagate this
277
+ // callback to the Onboarding host's delegate. Only treat dismissal of the
278
+ // Onboarding hosting controller itself as a cancellation.
279
+ guard presentationController.presentedViewController === hostingController else { return }
263
280
  finish(completed: false)
264
281
  }
265
282
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framepayments-react-native",
3
- "version": "2.0.2",
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",