dev #14384 Правка ошибок отображения WPA КофеЛайк: add getInstalledrelatedApps log

This commit is contained in:
nikolay 2023-06-22 11:35:06 +04:00
parent 0ae4e31cfd
commit fcdb3d8fc7
4 changed files with 17 additions and 2 deletions

View File

@ -0,0 +1 @@
nikolay@arch.3860:1687414554

View File

@ -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() {

View File

@ -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;
}

View File

@ -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"
}]
}