Skip to content

Commit

Permalink
docs: Added JS example to iOS custom-code section (#2015)
Browse files Browse the repository at this point in the history
  • Loading branch information
nip3o authored and jcesarmobile committed Nov 13, 2019
1 parent 21914e9 commit c1a7e20
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion site/docs-md/ios/custom-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ CAP_PLUGIN(MyPlugin, "MyPlugin",
)
```

This makes `MyPlugin`, and the `echo` method available to the Capacitor web runtime.
This makes `MyPlugin`, and the `echo` method available to the Capacitor web runtime like this:

```javascript
import { Plugins } from "@capacitor/core"
const { MyPlugin } = Plugins

const result = await MyPlugin.echo({ value: "Hello World!" })
console.log(result.value)
```
## Private Native Code
Expand Down

0 comments on commit c1a7e20

Please sign in to comment.