From 798c7770b8069764c9e43a79f59976858d0e15ae Mon Sep 17 00:00:00 2001 From: Yaswanth Polisetti Date: Thu, 17 Sep 2026 16:55:07 +0530 Subject: [PATCH] fix(ios): make WebView configuration callback non-optional for Swift The block typedef had no nullability, so Swift imported it as (WKWebView?) -> Void and merchants had to unwrap before handing the web view to Minkasu. Mark the parameter _Nonnull to match the Flutter plugin and the SDK's own onWebViewReady:, and mark the setter argument nullable so passing nil to clear the callback is explicit. Co-Authored-By: Claude Fable 5.1 --- ios/HyperSdkReact.h | 4 ++-- ios/HyperSdkReact.mm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/HyperSdkReact.h b/ios/HyperSdkReact.h index 85ed695..599da25 100644 --- a/ios/HyperSdkReact.h +++ b/ios/HyperSdkReact.h @@ -14,7 +14,7 @@ #import #import -typedef void (^JuspayWebViewConfigurationCallback)(WKWebView *webView); +typedef void (^JuspayWebViewConfigurationCallback)(WKWebView * _Nonnull webView); @interface HyperSdkReact : RCTEventEmitter @@ -24,7 +24,7 @@ typedef void (^JuspayWebViewConfigurationCallback)(WKWebView *webView); @property (nonatomic, strong) NSMutableDictionary *hyperDelegatesDict; @property (nonatomic, strong) NSMutableSet *knownEventKeys; -+ (void)setJuspayWebViewConfigurationCallback:(JuspayWebViewConfigurationCallback)callback; ++ (void)setJuspayWebViewConfigurationCallback:(nullable JuspayWebViewConfigurationCallback)callback; + (nullable JuspayWebViewConfigurationCallback)juspayWebViewConfigurationCallback; @end diff --git a/ios/HyperSdkReact.mm b/ios/HyperSdkReact.mm index 8ec4aa9..051ccb8 100644 --- a/ios/HyperSdkReact.mm +++ b/ios/HyperSdkReact.mm @@ -216,7 +216,7 @@ @implementation HyperSdkReact static JuspayWebViewConfigurationCallback _juspayWebViewConfigurationCallback = nil; -+ (void)setJuspayWebViewConfigurationCallback:(JuspayWebViewConfigurationCallback)callback { ++ (void)setJuspayWebViewConfigurationCallback:(nullable JuspayWebViewConfigurationCallback)callback { _juspayWebViewConfigurationCallback = [callback copy]; }