11pod 'AFNetworking' , :git => 'https://github.com/nativescript-community/AFNetworking'
2+
3+ post_install do |installer |
4+ # Remove private netinet6/in6.h header (conflicts in iPhoneSimulator SDK >= 26.4s).
5+ # netinet/in.h already covers the needed IPv6 definitions.
6+ reachability_m = File . join ( File . dirname ( __FILE__ ) , 'Pods' , 'AFNetworking/AFNetworking' , 'AFNetworkReachabilityManager.m' )
7+ puts "[post_install] Patching #{ reachability_m } — exists: #{ File . exist? ( reachability_m ) } "
8+ if File . exist? ( reachability_m )
9+ File . chmod ( 0644 , reachability_m )
10+ content = File . read ( reachability_m )
11+ patched = content . gsub ( "#import <netinet6/in6.h>\n " , "" )
12+ File . write ( reachability_m , patched )
13+ puts "[post_install] Patch applied: #{ !patched . include? ( 'netinet6' ) } "
14+ end
15+ sessionManager_m = File . join ( File . dirname ( __FILE__ ) , 'Pods' , 'AFNetworking/AFNetworking' , 'AFHTTPSessionManager.m' )
16+ puts "[post_install] Patching #{ sessionManager_m } — exists: #{ File . exist? ( sessionManager_m ) } "
17+ if File . exist? ( sessionManager_m )
18+ File . chmod ( 0644 , sessionManager_m )
19+ content = File . read ( sessionManager_m )
20+ patched = content . gsub ( "#import <netinet6/in6.h>\n " , "" )
21+ File . write ( sessionManager_m , patched )
22+ puts "[post_install] Patch applied: #{ !patched . include? ( 'netinet6' ) } "
23+ end
24+ end
0 commit comments