Skip to content

Commit 2012e12

Browse files
committed
Update plugins docs
1 parent 9e8c34d commit 2012e12

File tree

2 files changed

+82
-59
lines changed

2 files changed

+82
-59
lines changed

CocoaPods.md

+26-13
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ To work with such libraries, you need to wrap them as a custom NativeScript plug
1212
## Install CocoaPods
1313
You need to install CocoaPods. If you haven't yet, you can do so by running:
1414

15-
```
15+
```bash
1616
$ sudo gem install cocoapods
1717
```
1818
> **NOTE:** All operations and code in this article are verified against CocoaPods 0.38.2.
1919
2020
To check your current version, run the following command.
2121

22-
```
22+
```bash
2323
$ pod --version
2424
```
2525

@@ -33,26 +33,26 @@ sudo gem install cocoapods
3333
To start, create a project and add the iOS platform.
3434

3535
```bash
36-
$ tns create MYCocoaPods
37-
$ cd MYCocoaPods
36+
$ tns create MYCocoaPodsApp
37+
$ cd MYCocoaPodsApp
3838
$ tns platform add ios
3939
```
4040

4141
## Wrap the Library as NativeScript Plugin
4242

4343
For more information about working with NativeScript plugins, click [here](PLUGINS.md).
4444

45-
```
45+
```bash
4646
cd ..
4747
mkdir my-plugin
4848
cd my-plugin
4949
```
5050

51-
Create a package.json file with the following content:
51+
Create a `package.json` file with the following content:
5252

53-
```
53+
```json
5454
{
55-
"name": "myplugin",
55+
"name": "my-plugin",
5656
"version": "0.0.1",
5757
"nativescript": {
5858
"platforms": {
@@ -72,18 +72,31 @@ my-plugin/
7272
└── Podfile
7373
```
7474

75+
Podfile:
76+
```
77+
pod 'GoogleMaps'
78+
```
79+
80+
## Install the Plugin
81+
7582
Next, install the plugin:
7683

77-
```
84+
```bash
7885
tns plugin add ../my-plugin
7986
```
8087

81-
## Build the project
88+
> **NOTE:** Installing CocoaPods sets the deployment target of your app to iOS 8, if not already set to iOS 8 or later. This change is required because CocoaPods are installed as shared frameworks to ensure that all symbols are available at runtime.
8289
83-
```
90+
## Build the Project
91+
92+
```bash
8493
tns build ios
8594
```
8695

87-
This modifies the `MYCocoaPods.xcodeproj` and creates a workspace with the same name.
96+
This modifies the `MYCocoaPodsApp.xcodeproj` and creates a workspace with the same name.
97+
98+
> **IMPORTANT:** You will no longer be able to run the `xcodeproj` alone. NativeScript CLI will build the newly created workspace and produce the correct package.
99+
100+
## Troubleshooting
88101

89-
> **IMPORTANT:** You will no longer be able to run the `xcodeproj` alone. NativeScript CLI will build the newly created workspace and produce the correct .ipa.
102+
In case of post-build linker errors, you might need to resolve missing dependencies to native frameworks required by the installed CocoaPod. For more information about how to create the required links, see the [build.xcconfig specification](PLUGINS.md#buildxcconfig-specification).

0 commit comments

Comments
 (0)