Skip to content

chore: fix Swift 6 warnings and deprecated API usage #3146

@hyochan

Description

@hyochan

Summary

Fix compiler warnings identified during CI builds to prepare for Swift 6 compatibility and address deprecated API usage.

Warnings to Address

Swift 6 Compatibility (Priority: High)

File Line Warning Fix
RnIapHelper.swift 8 class 'OpenIapException' must restate inherited '@unchecked Sendable' conformance Add explicit @unchecked Sendable conformance
HybridRnIap.swift 136 reference to captured var 'products' in concurrently-executing code Capture products as a local constant before closure

Unused Results (Priority: Low)

File Line Warning Fix
HybridRnIap.swift 332 result of call to 'run(resultType:body:)' is unused Add _ = or use @discardableResult

Deprecated API Usage (Priority: Medium)

File Line Warning Fix
HybridRnIap.swift 355 'validateReceiptIOS' is deprecated: Use verifyPurchase Migrate to verifyPurchase when removing deprecated API
HybridRnIap.swift 540 'requestPurchaseOnPromotedProductIOS()' is deprecated Migrate to promotedProductListenerIOS + requestPurchase

Notes

  • Swift 6 compatibility warnings should be prioritized as they will become errors in Swift 6
  • Deprecated API warnings are from OpenIAP library - coordinate with OpenIAP updates
  • react-native-nitro-modules warnings (AnyMapHolder.hpp deprecated) will be resolved when updating the Nitro Modules dependency

Related

Found during CI build of #3145

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions