-
Notifications
You must be signed in to change notification settings - Fork 562
docs: update plugin development guide #1421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: update plugin development guide #1421
Conversation
@implementation Echo | ||
### Supporting Swift Package Manager (SPM) | ||
|
||
Starting from Cordova-iOS 8 and greater, support for the Swift Package Manager (SPM) has been implemented. To start using SPM with your plugin, a `Package.swift` file will need to be created in the plugin's root directory and a couple of things needs to be set and made aware in the `plugin.xml`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should mention in here the package="swift"
attribute in plugin.xml
interface. If your plugin requires a great deal of processing or | ||
requires a blocking call, you should use a background thread. For | ||
example: | ||
Plugin methods ordinarily execute in the same thread as the main interface. If your plugin requires a great deal of processing or requires a blocking call, you should use a background thread. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth mentioning that certain operations involving UI stuff (showing alerts, changing colours, etc.) can only run on the main thread
For additional reference, see the following classes: | ||
|
||
- [CDVPlugin.h][CDVPlugin.h] | ||
- [CDVPlugin.m][CDVPlugin.m] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to link to https://apache.github.io/cordova-ios/documentation/cordova/cdvplugin here
|
||
## CDVPluginResult Message Types | ||
|
||
You can use `CDVPluginResult` to return a variety of result types back to the JavaScript callbacks, using class methods that follow this pattern: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to link to https://apache.github.io/cordova-ios/documentation/cordova/cdvpluginresult around here
(and then also improve the comments in the ObjC code so that documentation is more useful)
Motivation, Context & Description
Update and improve the plugin development guide including the iOS portion of the guide.
Closes #974
Testing
n/a
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)