DylanVann / react-native-fast-image

🚩 FastImage, performant React Native image component.
MIT License
8.17k stars 1.5k forks source link

[IOS][webP] webP show blank on IOS 13.6 #898

Closed LouisWT closed 2 years ago

LouisWT commented 2 years ago

Describe the bug webP show blank on IOS 13.6.

To Reproduce display webp image on IOS 13.6. IOS >= 14 and Android shows well. IOS 13.6 shows blank.

Expected behavior webP shows well on IOS 13.6.

Dependency versions

podfile:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.0'

ENVFILES = {
  'Debug' => '$(PODS_ROOT)/../../.env.dev',
  'Release' => '$(PODS_ROOT)/../../.env.prod',
  'Daily' => '$(PODS_ROOT)/../../.env.daily',
}

def react_native_post_install(installer)
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          # Set 9.0 as min version for all
          if Gem::Version.new('9.0') > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
            config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
          end
      if target.name == 'react-native-config'
        config.build_settings['ENVFILE'] = ENVFILES[config.name]
      end
        end
    end
end

target 'app' do
  config = use_native_modules!

  pod 'GoogleMLKit/BarcodeScanning', '2.3.0'

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
  pod 'Permission-FaceID', :path => "#{permissions_path}/FaceID"
  pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications"

  pod 'RNFS', :path => '../node_modules/react-native-fs'

  target 'appTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!({ 'Flipper-Folly' => '2.5.3', 'Flipper' => '0.75.1', 'Flipper-RSocket' => '1.3.1' })

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end
LouisWT commented 2 years ago

Solved, need to call

 SDImageWebPCoder *webPCoder = [SDImageWebPCoder sharedCoder];
 [[SDImageCodersManager sharedManager] addCoder:webPCoder];

in the AppDelegate.m

ratz6 commented 1 year ago

@LouisWT @DylanVann even though I call I still don't see webP images being loaded in an online simulator. ( tested on iOS 12.5.5, 12.5.7 and 13.6 ) Is there anything else needed ?

rn-fast-image version > 8.6.3 react-native version > 0.71.6