stripe / stripe-ios

Stripe iOS SDK
https://stripe.com
MIT License
2.13k stars 985 forks source link

[Feature] Request to Dynamically Fetch hCaptcha HTML Instead of Including it in the Stripe iOS SDK #3959

Open jesus-mg-ios opened 3 months ago

jesus-mg-ios commented 3 months ago

Hi Stripe Team,

I noticed that the Stripe iOS SDK includes the hCaptcha HTML directly in the source file HCaptchaHtml.swift.

Describe the solution you'd like

I would like to suggest an improvement: instead of embedding the hCaptcha HTML directly in the SDK, consider fetching it dynamically from the network when needed. Here are a few reasons why this approach would be beneficial:

Reduced SDK Size: By not including the hCaptcha HTML directly in the SDK, the overall size of the SDK can be reduced. This would help developers keep their apps more lightweight and efficient. Easier Updates and Maintenance: Fetching the hCaptcha HTML dynamically allows for easier updates and maintenance. If there are any changes or updates to hCaptcha, they can be made server-side without requiring an update to the SDK, ensuring users always have the latest version.

Describe alternatives you've considered

-

Additional context

-

davidme-stripe commented 2 months ago

Thanks for the suggestion! This is per hCaptcha's recommendation, and it adds ~13kb to the uncompressed app size. We'll consider this for a future update.

jesus-mg-ios commented 2 months ago

@davidme-stripe the url is private. Thanks in advance

jesus-mg-ios commented 2 months ago

Also there are some jsons like au_becs_bsb.json and localized_address_data.json that inside asset.car can reduce the binary size. Even you can play with the compression type in the inspector panel when you include it in assets.