fix(ios): make WebView configuration callback non-optional for Swift - #196
Merged
Merged
Conversation
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
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JuspayWebViewConfigurationCallbackblock typedef introduced in 5.0.36 carries no nullability, so Swift imports it as(WKWebView?) -> Voidand merchants have to unwrap the web view before handing it to Minkasu — unlike the Flutter plugin ((WKWebView) -> ()) and the SDK's ownonWebViewReady:(WKWebView * _Nonnull)._Nonnull, so Swift now sees(WKWebView) -> Void.nullable, so passingnilto clear the callback is explicit (the implementation already handles it).guard let webView = webViewwritten against the optional signature stops compiling once the type becomes non-optional.No other declarations in
HyperSdkReact.hare touched, so this adds no nullability warnings beyond what 5.0.36 already emits.Test plan
swiftc -typecheckof a merchant snippet with the closure explicitly typed(webView: WKWebView): compiles with this change; fails against 5.0.36 withcannot convert '(WKWebView) -> ()' to '(Optional<WKWebView>) -> ()'.setJuspayWebViewConfigurationCallback(nil)is accepted.-Werror.pod installin the example app and confirm the Minkasu callback receives theWKWebViewon a real bank page.🤖 Generated with Claude Code