WebPush in PWA

Hi there.

In my work, we tried integrate Safari Push unsuccessful. We have the files .p12 and the .cer

When execute in Safari, not work, no response. If change the name of callback, for example for "console.log('hi')"... print "hi" and in the console I see the error

"TypeError: undefined in not an object (evaluating 'window.safari.pushNotification.requestPErmission('https://fabse.tv, pushId, { user: '123456'}, console.log('hi'))')"


This is my code:
my pushId: 'web.fbase.tv'


setupPushWeb() {
  const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
  var checkRemotePermission = function (permissionData) {
  if (permissionData.permission === 'default') {
  // This is a new web service URL and its validity is unknown.
  window.safari.pushNotification.requestPermission(
  'https://fbase.tv', // The web service URL.
  'web.fbase.tv', // The Website Push ID.
  {user: '123456'}, // Data used to help you identify the user.
  checkRemotePermission // The callback function.
  );
  }
  else if (permissionData.permission === 'denied') {
  // The user said no.
  }
  else if (permissionData.permission === 'granted') {
  // The web service URL is a valid push provider, and the user said yes.
  // permissionData.deviceToken is now available to use.
  }
  }

  if(isSafari) {

  if ('safari' in window && 'pushNotification' in window.safari) {
  var permissionData = window.safari.pushNotification.permission('web.fbase.tv');
  checkRemotePermission(permissionData);
  }

  } else {
  //Firebase integration Fine

Hi,


The Push API is not supported in Safari. That is why you are receiving the error.

WebPush in PWA
 
 
Q