UIWebView存在在AFNetworking,导致APP store不通过

UIWebView存在在AFNetworking,导致APP store不通过~~~~~

唉唉网上好多方案都不适合我!!!哭嘁嘁

我只写适合我的吧,参考参考就好啦

解决方案的基本思想就是 remove掉关于所有这个UIWebView的文件

(1)vim Podfile

abstract_target 'BasePods' do
pod 'AFNetworking', '=2.5.4'

# remove UIKit(UIWebView) rejected by AppStore
pre_install do |installer|
    puts 'pre_install begin....'
    dir_af = File.join(installer.sandbox.pod_dir('AFNetworking'), 'UIKit+AFNetworking')
    Dir.foreach(dir_af) {|x|
      real_path = File.join(dir_af, x)
      if (!File.directory?(real_path) && File.exists?(real_path))
        if((x.start_with?('UIWebView') || x == 'UIKit+AFNetworking.h'))
          File.delete(real_path)
          puts 'delete:'+ x
        end
      end
    }
    puts 'end pre_install.'
end

end

最重点就是;

# remove UIKit(UIWebView) rejected by AppStore
pre_install do |installer|
    puts 'pre_install begin....'
    dir_af = File.join(installer.sandbox.pod_dir('AFNetworking'), 'UIKit+AFNetworking')
    Dir.foreach(dir_af) {|x|
      real_path = File.join(dir_af, x)
      if (!File.directory?(real_path) && File.exists?(real_path))
        if((x.start_with?('UIWebView') || x == 'UIKit+AFNetworking.h'))
          File.delete(real_path)
          puts 'delete:'+ x
        end
      end
    }
    puts 'end pre_install.'
end
这段脚本吧

(2)pod install

Analyzing dependencies

Downloading dependencies

pre_install begin....

delete:UIWebView+AFNetworking.h

delete:UIKit+AFNetworking.h

delete:UIWebView+AFNetworking.m

end pre_install.

Generating Pods project

Integrating client project

Pod installation complete! There are 11 dependencies from the Podfile and 13 total pods installed.

看到结果是不是很完美,哈哈哈哈哈哈~~~~

 

你可能感兴趣的:(UIWebView存在在AFNetworking,导致APP store不通过)