Skip to content

Commit 2eba830

Browse files
committed
docs: add docs for previewQrCodeService in PublicApi.md
1 parent 5b09642 commit 2eba830

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

PublicAPI.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const tns = require("nativescript");
6464
* [deviceLost](#devicelost)
6565
* [deviceLog](#devicelog)
6666
* [previewQrCodeService](#previewqrcodeservice)
67-
* [getPlaygroundAppQrCode](#getplaygroundappqrCode)
67+
* [getPlaygroundAppQrCode](#getplaygroundappqrcode)
6868

6969
## Module projectService
7070

@@ -1409,6 +1409,21 @@ tns.previewDevicesService.on("deviceLogData", (device, message) => {
14091409
});
14101410
```
14111411
1412+
## previewQrCodeService
1413+
The `previewQrCodeService` exposes methods for getting information about the QR of the Playground app and deployed app in Preview app.
1414+
1415+
### getPlaygroundAppQrCode
1416+
Returns information used to generate the QR code of the Playground app.
1417+
1418+
* Usage:
1419+
```TypeScript
1420+
tns.previewQrCodeService.getPlaygroundAppQrCode()
1421+
.then(result => {
1422+
console.log("QR code data for iOS platform: " + result.ios);
1423+
console.log("QR code data for Android platform: " + result.android);
1424+
});
1425+
```
1426+
14121427
## How to add a new method to Public API
14131428
CLI is designed as command line tool and when it is used as a library, it does not give you access to all of the methods. This is mainly implementation detail. Most of the CLI's code is created to work in command line, not as a library, so before adding method to public API, most probably it will require some modification.
14141429
For example the `$options` injected module contains information about all `--` options passed on the terminal. When the CLI is used as a library, the options are not populated. Before adding method to public API, make sure its implementation does not rely on `$options`.

0 commit comments

Comments
 (0)