Skip to content

fix(ios): make WebView configuration callback non-optional for Swift - #196

Merged
vraghunandhan merged 1 commit into
mainfrom
fix/webview-callback-followups
Sep 17, 2026
Merged

vraghunandhan merged 1 commit into
mainfrom
fix/webview-callback-followups

Conversation

@Yaswanth0606

Copy link
Copy Markdown
Contributor

Summary

  • The JuspayWebViewConfigurationCallback block typedef introduced in 5.0.36 carries no nullability, so Swift imports it as (WKWebView?) -> Void and merchants have to unwrap the web view before handing it to Minkasu — unlike the Flutter plugin ((WKWebView) -> ()) and the SDK's own onWebViewReady:(WKWebView * _Nonnull).
  • Mark the block parameter _Nonnull, so Swift now sees (WKWebView) -> Void.
  • Mark the setter argument nullable, so passing nil to clear the callback is explicit (the implementation already handles it).
  • Landing this before merchants adopt 5.0.36 avoids a source-breaking change later: a guard let webView = webView written against the optional signature stops compiling once the type becomes non-optional.

No other declarations in HyperSdkReact.h are touched, so this adds no nullability warnings beyond what 5.0.36 already emits.

Test plan

  • swiftc -typecheck of a merchant snippet with the closure explicitly typed (webView: WKWebView): compiles with this change; fails against 5.0.36 with cannot convert '(WKWebView) -> ()' to '(Optional<WKWebView>) -> ()'. setJuspayWebViewConfigurationCallback(nil) is accepted.
  • clang syntax check of the new declarations under -Werror.
  • pod install in the example app and confirm the Minkasu callback receives the WKWebView on a real bank page.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@vraghunandhan
vraghunandhan merged commit 24ff2c1 into main Sep 17, 2026
8 checks passed
@vraghunandhan
vraghunandhan deleted the fix/webview-callback-followups branch September 17, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants