@@ -11,23 +11,26 @@ export class PlaygroundQrCodeGenerator implements IPlaygroundQrCodeGenerator {
11
11
}
12
12
13
13
public async generateQrCodeForiOS ( ) : Promise < void > {
14
- await this . generateQrCode ( PlaygroundStoreUrls . APP_STORE_URL ) ;
14
+ const message = `Scan the QR code below to install ${ "NativeScript Playground app" . underline . bold } on your ${ "iOS" . underline . bold } device or get it from ${ PlaygroundStoreUrls . APP_STORE_URL . underline . bold } .` ;
15
+ await this . generateQrCode ( PlaygroundStoreUrls . APP_STORE_URL , message ) ;
15
16
}
16
17
17
18
public async generateQrCodeForAndroid ( ) : Promise < void > {
18
- await this . generateQrCode ( PlaygroundStoreUrls . GOOGLE_PLAY_URL ) ;
19
+ const message = `Scan the QR code below to install ${ "NativeScript Playground app" . underline . bold } on your ${ "Android" . underline . bold } device or get it from ${ PlaygroundStoreUrls . GOOGLE_PLAY_URL . underline . bold } .` ;
20
+ await this . generateQrCode ( PlaygroundStoreUrls . GOOGLE_PLAY_URL , message ) ;
19
21
}
20
22
21
23
public async generateQrCodeForCurrentApp ( options : IHasUseHotModuleReloadOption ) : Promise < void > {
22
- await this . generateQrCode ( this . $previewSdkService . getQrCodeUrl ( options ) ) ;
24
+ const message = `Use ${ "NativeScript Playground app" . underline . bold } and scan the QR code below to preview the application on your device.` ;
25
+ await this . generateQrCode ( this . $previewSdkService . getQrCodeUrl ( options ) , message ) ;
23
26
}
24
27
25
- private async generateQrCode ( url : string ) : Promise < void > {
26
- await this . generateQrCodeCore ( url ) ;
28
+ private async generateQrCode ( url : string , message : string ) : Promise < void > {
29
+ await this . generateQrCodeCore ( url , message ) ;
27
30
this . printUsage ( ) ;
28
31
}
29
32
30
- private async generateQrCodeCore ( url : string ) : Promise < void > {
33
+ private async generateQrCodeCore ( url : string , message : string ) : Promise < void > {
31
34
const shortenUrlEndpoint = util . format ( this . $config . SHORTEN_URL_ENDPOINT , encodeURIComponent ( url ) ) ;
32
35
try {
33
36
const response = await this . $httpClient . httpRequest ( shortenUrlEndpoint ) ;
@@ -37,14 +40,14 @@ export class PlaygroundQrCodeGenerator implements IPlaygroundQrCodeGenerator {
37
40
// use the longUrl
38
41
}
39
42
40
- this . $qrCodeTerminalService . generate ( url ) ;
43
+ this . $qrCodeTerminalService . generate ( url , message ) ;
41
44
}
42
45
43
46
private printUsage ( ) : void {
44
47
this . $logger . info ( `
45
- -> Press ${ this . underlineBoldCyan ( "a" ) } to show the QR code of NativeScript Playground app for ${ this . underlineBoldCyan ( "Android" ) } devices
46
- -> Press ${ this . underlineBoldCyan ( "i" ) } to show the QR code of NativeScript Playground app for ${ this . underlineBoldCyan ( "iOS" ) } devices
47
- -> Press ${ this . underlineBoldCyan ( "c" ) } to display the QR code of the ${ this . underlineBoldCyan ( "current application" ) } .
48
+ -> Press ${ this . underlineBoldCyan ( "a" ) } to get a link to NativeScript Playground app for ${ this . underlineBoldCyan ( "Android" ) }
49
+ -> Press ${ this . underlineBoldCyan ( "i" ) } to get a link to NativeScript Playground app for ${ this . underlineBoldCyan ( "iOS" ) }
50
+ -> Press ${ this . underlineBoldCyan ( "c" ) } to show the QR code of the ${ this . underlineBoldCyan ( "current application" ) } .
48
51
` ) ;
49
52
}
50
53
0 commit comments