fix: deprecate initialize() method and fix iOS type casting issue#513
Merged
fix: deprecate initialize() method and fix iOS type casting issue#513
Conversation
- Add @deprecated annotation to initialize() method pointing to initConnection() - Fix iOS type casting issue by converting boolean to string - This resolves the runtime error: type 'bool' is not a subtype of type 'String?' - Will be removed in version 7.0.0 Breaking change: Users should migrate from initialize() to initConnection()
hyochan
added a commit
that referenced
this pull request
Jul 27, 2025
## Summary - Add @deprecated annotation to initialize() method pointing to initConnection() - Fix iOS type casting issue by converting boolean to string - This resolves the runtime error: type 'bool' is not a subtype of type 'String?' ## Breaking Change Users should migrate from `initialize()` to `initConnection()`. The deprecated method will be removed in version 7.0.0. ## Problem The `initialize()` method on iOS calls `canMakePayments` which returns a boolean, but the method signature expects `String?`, causing a type casting error. ## Solution 1. Deprecate the `initialize()` method in favor of `initConnection()` 2. Fix the immediate issue by converting the boolean to string 3. All documentation has been updated to use `initConnection()` (in separate PR) ## Test Tested on real iOS device with sandbox environment - no more type casting errors.
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
Breaking Change
Users should migrate from
initialize()toinitConnection(). The deprecated method will be removed in version 7.0.0.Problem
The
initialize()method on iOS callscanMakePaymentswhich returns a boolean, but the method signature expectsString?, causing a type casting error.Solution
initialize()method in favor ofinitConnection()initConnection()(in separate PR)Test
Tested on real iOS device with sandbox environment - no more type casting errors.