Skip to content

Commit 9db57a1

Browse files
author
Dmitriy Grachev
committed
updated README about linking with use_frameworks #344
1 parent 340db11 commit 9db57a1

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,31 @@ $ yarn add react-native-permissions
2727

2828
By default no permission handler is installed. Update your `Podfile` by choosing the ones you want to check or request, then run `pod install`.
2929

30+
```ruby
31+
# if you have prebuild dynamic cocoapods dependencies and could not migrate
32+
# to use_modular_headers you should use workaround for linking app with dynamic frameworks
33+
# and with static libraries by placing this code at the top of Podfile
34+
#
35+
# Add this code at the top of Podfile right after platform definition
36+
use_frameworks!
37+
38+
dynamic_frameworks = ['RxCocoa', 'RxSwift', 'WhatEverSDKName']
39+
40+
# make all the other dependencies into static libraries by overriding the static_library
41+
pre_install do |installer|
42+
installer.pod_targets.each do |pod|
43+
if !dynamic_frameworks.include?(pod.name)
44+
puts "Overriding the static_library for #{pod.name}"
45+
def pod.build_type;
46+
Pod::Target::BuildType.static_library
47+
# for static framework -
48+
# Pod::Target::BuildType.static_framework
49+
end
50+
end
51+
end
52+
end
53+
```
54+
3055
```ruby
3156
# 🚨 If you use use_framework! 🚨
3257
# - Ensure that you have installed at least Cocoapods 1.5.0

0 commit comments

Comments
 (0)