Good afternoon, the problem is that the request does not work, the request to subscribe to push notifications in safari 10, in safari 9 everything works and the push reaches the addressee. Code standard from documentation:
const websitePushID = 'web.ru.xxx'; const webServiceUrl = 'https://xxx.ru'; var permissionData = {}; window.addEventListener('load', function () { webPush.pushButton = $('.js-push-btn') || false; if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/service-worker.js').then(webPush.initialiseState); } else { if ('safari' in window && 'pushNotification' in window.safari) { permissionData = window.safari.pushNotification.permission(websitePushID); } } }); $(document).ready(function () { $('.js-push-btn').on('click', function () { checkRemotePermission(permissionData); }); }); var checkRemotePermission = function (permissionData) { if (permissionData.permission === 'default') { try { console.log('default'); window.safari.pushNotification.requestPermission( webServiceUrl, websitePushID, {}, checkRemotePermission ); } catch (e) { console.log(e); } } else if (permissionData.permission === 'denied') { console.log('denied'); } else if (permissionData.permission === 'granted') { console.log('granted'); } }; After clicking the button, 'default' is displayed in the console, then 'denied'. That is, the function callback works, but apparently with an error. xxx / v1 / log in theory write logs
file_put_contents ('./files/logs.txt', json_encode ($_REQUEST)); However, in the logs.txt file there is an empty [] array. If there was an incorrect pushPackage, then the whole thing would not work in Safari 9, but since It works - I'll never know what's the matter.