dev #14384 Правка ошибок отображения WPA КофеЛайк: add getInstalledrelatedApps log
This commit is contained in:
parent
0ae4e31cfd
commit
fcdb3d8fc7
1
angular/src/app/directives/.#download-app.directive.ts
Symbolic link
1
angular/src/app/directives/.#download-app.directive.ts
Symbolic link
@ -0,0 +1 @@
|
||||
nikolay@arch.3860:1687414554
|
||||
@ -1,6 +1,6 @@
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { MessagingService } from 'src/app/services/messaging.service';
|
||||
import { getTypeDevice, DeviceType } from 'src/app/utils';
|
||||
import { getTypeDevice, DeviceType, pwaInstalled } from 'src/app/utils';
|
||||
import { AppleWalletService } from 'src/app/services/apple-wallet.service';
|
||||
import { CookiesService } from 'src/app/services/cookies.service';
|
||||
import { MatBottomSheet } from '@angular/material/bottom-sheet';
|
||||
@ -40,6 +40,8 @@ export class NavbarComponent implements OnInit {
|
||||
const deviceType = getTypeDevice();
|
||||
|
||||
this.showMenu = deviceType === DeviceType.ios;
|
||||
|
||||
pwaInstalled();
|
||||
}
|
||||
|
||||
toggleMenu() {
|
||||
|
||||
@ -8,3 +8,11 @@ export function getTypeDevice(): DeviceType {
|
||||
const ios = /iphone|ipod|ipad/.test(userAgent);
|
||||
return ios ? DeviceType.ios : DeviceType.android;
|
||||
}
|
||||
|
||||
export async function pwaInstalled(): Promise<boolean> {
|
||||
if ("getInstalledRelatedApps" in navigator) {
|
||||
const apps = await (window.navigator as any).getInstalledRelatedApps();
|
||||
console.log(apps)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -50,5 +50,9 @@
|
||||
"purpose": "maskable any"
|
||||
}
|
||||
],
|
||||
"gcm_sender_id": "99855572145"
|
||||
"gcm_sender_id": "99855572145",
|
||||
"related_applications": [{
|
||||
"platform": "webapp",
|
||||
"url": "https://coffee-like-test.lk.crm4retail.ru/manifest.webmanifest"
|
||||
}]
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user