You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CocoaPods.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -99,4 +99,4 @@ This modifies the `MYCocoaPodsApp.xcodeproj` and creates a workspace with the sa
99
99
100
100
## Troubleshooting
101
101
102
-
If there are linker errors after building, you may have to link with some native frameworks described in the CocoaPod documentation. See [`build.xcconfig` file](PLUGINS.md#buildxcconfig-specification) specification on how to do this.
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).
Copy file name to clipboardExpand all lines: PLUGINS.md
+7-8
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ A NativeScript plugin is any npm package, published or not, that exposes a nativ
26
26
* One or more CommonJS modules that expose a native API via a unified JavaScript API. For more information about Common JS modules, see the [CommonJS Wiki](http://wiki.commonjs.org/wiki/CommonJS).
27
27
* (Optional) `AndroidManifest.xml` and `Info.plist` which describe the permissions, features or other configurations required or used by your app for Android and iOS, respectively.
28
28
* (Optional) Native Android libraries and the native Android `include.gradle` configuration file which describes the native dependencies. For more information, see the [`include.gradle` Specification](#includegradle-specification) section.
29
-
* (Optional) Native iOS libraries and the native `build.xcconfig` configuration file which describes the native dependencies. For more information, see the [Build.xcconfig Specification](#buildxcconfig-specification) section.
29
+
* (Optional) Native iOS libraries and the native `build.xcconfig` configuration file which describes the native dependencies. For more information, see the [`build.xcconfig` Specification](#buildxcconfig-specification) section.
30
30
31
31
The plugin must have the directory structure, described in the [Directory Structure](#directory-structure) section.
32
32
@@ -62,6 +62,7 @@ NativeScript plugins which consist of multiple CommonJS modules might have the f
62
62
63
63
```
64
64
my-plugin/
65
+
├── index.js
65
66
├── package.json
66
67
├── MyModule1/
67
68
│ ├── index1.js
@@ -71,20 +72,17 @@ my-plugin/
71
72
│ └── package.json
72
73
└── platforms/
73
74
├── android/
74
-
│ ├── res/
75
-
│ └── AndroidManifest.xml
75
+
│ ├── AndroidManifest.xml
76
+
│ └── res/
76
77
└── ios/
77
78
└── Info.plist
78
79
```
79
80
80
81
*`index.js`: This file is the CommonJS module which exposes the native API. You can use platform-specific `*.platform.js` files. For example: `index.ios.js` and `index.android.js`. During the plugin installation, the NativeScript CLI will copy the platform resources to the `tns_modules` subdirectory in the correct platform destination in the `platforms` directory of your project.<br/>Alternatively, you can give any name to this CommonJS module. In this case, however, you need to point to this file by setting the `main` key in the `package.json` for the plugin. For more information, see [Folders as Modules](https://nodejs.org/api/modules.html#modules_folders_as_modules).
81
82
*`package.json`: This file contains the metadata for your plugin. It sets the supported runtimes, the plugin name and version and any dependencies. The `package.json` specification is described in detail below.
82
83
*`platforms\android\AndroidManifest.xml`: This file describes any specific configuration changes required for your plugin to work. For example: required permissions. For more information about the format of `AndroidManifest.xml`, see [App Manifest](http://developer.android.com/guide/topics/manifest/manifest-intro.html).<br/>During build, gradle will merge the plugin `AndroidManifest.xml` with the `AndroidManifest.xml` for your project. The NativeScript CLI will not resolve any contradicting or duplicate entries during the merge. After the plugin is installed, you need to manually resolve such issues.
83
-
*`platforms\android\include.gradle`: This file modifies the native Android configuration of your NativeScript project such as native dependencies, build types and configurations. For more information about the format of `include.gradle`, see [`include.gradle` file](#includegradle-specification).
84
84
*`platforms\android\res`: (Optional) This directory contains resources declared by the `AndroidManifest.xml` file. You can look at the folder structure [here](http://developer.android.com/guide/topics/resources/providing-resources.html#ResourceTypes).
85
85
*`platforms\ios\Info.plist`: This file describes any specific configuration changes required for your plugin to work. For example, required permissions. For more information about the format of `Info.plist`, see [About Information Property List Files](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html).<br/>During the plugin installation, the NativeScript CLI will merge the plugin `Info.plist` with the `Info.plist` for your project. The NativeScript CLI will not resolve any contradicting or duplicate entries during the merge. After the plugin is installed, you need to manually resolve such issues.
86
-
*`platforms\ios\Podfile`: This file describes the dependency to the library that you want to use. For more information, see [CocoaPods.md](CocoaPods.md).
87
-
*`platforms\ios\build.xcconfig`: This file modifies the native iOS configuration of your NativeScript project such as native dependencies and configurations. For more information about the format of `build.xcconfig`, see [`build.xcconfig` file](#buildxcconfig-specification).
88
86
89
87
NativeScript plugins which contain both native Android and iOS libraries might have the following directory structure.
90
88
@@ -106,11 +104,12 @@ my-plugin/
106
104
```
107
105
108
106
*`platforms\android`: This directory contains any native Android libraries packaged as `*.jar` and `*.aar` packages. These native libraries can reside in the root of this directory or in a user-created sub-directory. During the plugin installation, the NativeScript CLI will configure the Android project in `platforms\android` to work with the plugin.
109
-
*`platforms\android\res`: (Optional) This directory contains resources declared by the `AndroidManifest.xml` file. You can look at the folder structure [here](http://developer.android.com/guide/topics/resources/providing-resources.html#ResourceTypes).
110
107
*`platforms\android\include.gradle`: This file modifies the native Android configuration of your NativeScript project such as native dependencies, build types and configurations. For more information about the format of `include.gradle`, see [`include.gradle` file](#includegradle-specification).
111
108
*`platforms\ios`: This directory contains native iOS frameworks (both static and shared). During the plugin installation, the NativeScript CLI will copy these files to `lib\iOS` in your project and will configure the iOS project in `platforms\ios` to work with the frameworks. If the library is written in Swift, only APIs exposed to Objective-C are exposed to NativeScript.
109
+
*`platforms\ios\build.xcconfig`: This file modifies the native iOS configuration of your NativeScript project such as native dependencies and configurations. For more information about the format of `build.xcconfig`, see [`build.xcconfig` file](#buildxcconfig-specification).
110
+
*`platforms\ios\Podfile`: This file describes the dependency to the library that you want to use. For more information, see [CocoaPods.md](CocoaPods.md).
112
111
113
-
### `package.json` Specification
112
+
### Package.json Specification
114
113
115
114
Every NativeScript plugin should contain a valid `package.json` file in its root. This `package.json` file must meet the following requirements.
0 commit comments