EkoLabs/react-native-background-downloader

iOS .podspec file missing

florandom opened this issue · 3 comments

.podspec file is missing after npm install or yarn add

From RN >= 0.60 this causes an issue running pod install

image

I fixed this by manually adding the Podspec file to node_modules/react-native-background-downloader/

Don't forget to use patch-package if node_modules is ignored by Git!

I have solved it like this.

$ cat postinstall.sh
#!/bin/bash
echo "Patching podspec for react-native-background-downloader"
if [[ -e ./node_modules/react-native-background-downloader/*.podspec ]]; then
  echo "podspec exists!"
  exit
fi

echo """
Pod::Spec.new do |s|
  s.name         = 'react-native-background-downloader'
  s.version      = '1.0.0'
  s.summary      = 'React Native background downloader'
  s.description  = <<-DESC
  A library for React-Native to help you download large files on iOS and Android both in the foreground and most importantly in the background.
                   DESC
  s.author       = 'elad@helleko.com'
  s.homepage     = 'https://github.com/EkoLabs/react-native-background-downloader'
  s.license      = 'MIT'
  s.platform     = :ios, '7.0'
  s.source       = { git: 'https://github.com/EkoLabs/react-native-background-downloader.git', tag: 'master' }
  s.source_files = 'ios/**/*.{h,m}'
  s.requires_arc = true

  s.dependency 'React'
end""" > ./node_modules/react-native-background-downloader/react-native-background-downloader.podspec

fixed in 2.1.1