Skip to content

fix: deprecate initialize() method and fix iOS type casting issue#513

Merged
hyochan merged 1 commit intomainfrom
fix/initialize-deprecation
Jul 27, 2025
Merged

fix: deprecate initialize() method and fix iOS type casting issue#513
hyochan merged 1 commit intomainfrom
fix/initialize-deprecation

Conversation

@hyochan
Copy link
Copy Markdown
Owner

@hyochan hyochan commented 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.

- 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 hyochan merged commit acfc633 into main Jul 27, 2025
1 check failed
@hyochan hyochan deleted the fix/initialize-deprecation branch July 27, 2025 00:59
@hyochan hyochan added the doc label Jul 27, 2025
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.
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.

1 participant