diff --git a/angular/src/app/directives/download-app.directive.ts b/angular/src/app/directives/download-app.directive.ts index 9a9ff17..0de44de 100644 --- a/angular/src/app/directives/download-app.directive.ts +++ b/angular/src/app/directives/download-app.directive.ts @@ -23,12 +23,17 @@ export class DownloadAppDirective implements OnInit { console.log('INSTALLED!!!'); }); if (!((this.deviceType == 'android' && this.deferredPrompt) || this.deviceType == 'ios')) { + console.log(this.deviceType); + console.log(this.deferredPrompt); + this.el.nativeElement.style.display = 'none' } } getTypeDevice() { const userAgent = window.navigator.userAgent.toLowerCase(); + console.log(userAgent); + const ios = /iphone|ipod|ipad/.test(userAgent); this.deviceType = ios ? 'ios' : 'android'; } @@ -38,6 +43,14 @@ export class DownloadAppDirective implements OnInit { if (event) { event.preventDefault(); } + if (this.deviceType === 'ios') { + this.messageService.add({ + severity: 'custom', + summary: `Для установки нажмите на кнопку поделиться в Вашем браузере и выберите пункт 'На экран «Домой»'`, + sticky: true + }); + return + } if (!this.deferredPrompt) { this.messageService.add({ severity: 'error',