Skip to content

Commit 5b09642

Browse files
committed
docs: add docs for liveSyncToPreviewApp method in PublicAPI.md
1 parent f0d2f8a commit 5b09642

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

PublicAPI.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,38 @@ tns.liveSyncService.liveSync([ androidDeviceDescriptor, iOSDeviceDescriptor ], l
775775
});
776776
```
777777
778+
779+
780+
781+
782+
783+
### liveSyncToPreviewApp
784+
Starts a LiveSync operation to the Preview app. After scanning the QR code with the scanner provided in the NativeScript Playground app, the app will be launched on a device through the Preview app. Additionally, any changes made to the project will be automatically synchronized with the deployed app.
785+
786+
* Definition
787+
```TypeScript
788+
/**
789+
* Starts LiveSync operation by producting a QR code and starting watcher.
790+
* @param {IPreviewAppLiveSyncData} liveSyncData Describes the LiveSync operation - for which project directory is the operation and other settings.
791+
* @returns {Promise<IQrCodeImageData>}
792+
*/
793+
liveSyncToPreviewApp(liveSyncData: IPreviewAppLiveSyncData): Promise<IQrCodeImageData>;
794+
```
795+
796+
* Usage:
797+
```JavaScript
798+
const liveSyncData = {
799+
projectDir,
800+
bundle: false,
801+
useHotModuleReload: false,
802+
env: { }
803+
};
804+
tns.liveSyncService.liveSyncToPreviewApp(liveSyncData)
805+
.then(qrCodeImageData => {
806+
console.log("The qrCodeImageData is: " + qrCodeImageData);
807+
});
808+
```
809+
778810
### stopLiveSync
779811
Stops LiveSync operation. In case deviceIdentifires are passed, the operation will be stopped only for these devices.
780812

0 commit comments

Comments
 (0)