parent
da340475e0
commit
5152d9ad30
@ -198,12 +198,14 @@
|
||||
}
|
||||
|
||||
.add-to-wallet {
|
||||
margin-top: 12px;
|
||||
height: 36px;
|
||||
border-radius: 8px;
|
||||
background: #09467f;
|
||||
border-color: #09467f;
|
||||
color: #fff;
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
margin: 12px auto 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,6 +34,7 @@ export class MainComponent implements OnInit {
|
||||
public el: ElementRef,
|
||||
public renderer: Renderer2,
|
||||
private messagingService: MessagingService,
|
||||
private messageService: MessageService,
|
||||
private cookiesService: CookiesService,
|
||||
) {
|
||||
route.queryParams.subscribe((params) => {
|
||||
@ -57,8 +58,14 @@ export class MainComponent implements OnInit {
|
||||
}
|
||||
|
||||
requestPermission() {
|
||||
if ('safari' in window) {
|
||||
console.log('safari');
|
||||
const userAgent = window.navigator.userAgent.toLowerCase();
|
||||
const ios = /iphone|ipod|ipad/.test(userAgent);
|
||||
if (ios) {
|
||||
this.messageService.add({
|
||||
severity: 'custom',
|
||||
summary: `Чтобы получать уведомления, добавьте карту в Apple Wallet`,
|
||||
life: 5000,
|
||||
});
|
||||
|
||||
// var permissionData = window.safari.pushNotification.permission('web.com.example.domain');
|
||||
// $scope.checkRemotePermission(permissionData);
|
||||
|
||||
@ -86,5 +86,9 @@ export class MessagingService {
|
||||
console.log('new message received. ', payload);
|
||||
this.currentMessage.next(payload);
|
||||
});
|
||||
this.angularFireMessaging.onMessage((res) => {
|
||||
console.log('@@@@: ', res);
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user