Skip to content

Commit

Permalink
chore(docs): Add pre_install hook instructions for Podfile (#18)
Browse files Browse the repository at this point in the history
* chore(docs): Add `pre_install` hook instructions for Podfile
  • Loading branch information
Steven0351 authored Jul 1, 2022
1 parent 5ebef45 commit c26b471
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,32 @@ int main(int argc, char *argv[])
```
##### Podfile
Because many of the Ionic Portals dependencies are comprised of Swift code and have custom module maps, you will need to add `use_frameworks!` to your iOS Podfile and remove `use_flipper!()`
There are two methods you may use to ensure Portals can integrate into your React Native application: a custom `pre_install` hook or adding `use_frameworks!` to your Podfile. Only one of these approaches is needed to ensure that Capacitor is compiled as a dynamic framework.
**pre_install**
Using the `pre_install` hook allows you to keep all the other React Native dependencies as static frameworks:
```ruby
# These frameworks are required to be dynamic.
dynamic_frameworks = ['Capacitor', 'CapacitorCordova']
pre_install do |installer|
installer.pod_targets.each do |pod|
if dynamic_frameworks.include?(pod.name)
def pod.static_framework?
false
end
def pod.build_type
Pod::BuildType.dynamic_framework
end
end
end
end
```

**use_frameworks**

Alternative to the `pre_install` hook, you can add `use_frameworks!` to your Podfile application target. Using this approach requires removing `use_flipper!()` from the Podfile.

### Communicating between React Native and Web
One of the key features of Ionic Portals for React Native is facilitating communication between the web and React Native layers of your application.
Expand Down

0 comments on commit c26b471

Please sign in to comment.