sending notifications from service worker

I have a pwa app that basically is a simple form. If the network is offline, it was saved to local storage(indexedDB) and send afterwards when the conexion is online. Up to here all is ok, but I would like to show a message to the user ‘the form was sent to the server’ and I couldn’t get it ok. I use the property ‘SYNC’ for doing this feature. In my service worker the part of the code relative to this feature is:

…..

self.addEventListener(‘sync’, e => {

console.log('SW: Sync');

if ( e.tag === 'new-form' ) {

    // send to DB when onLine
    const resp = sendForm(); //up to here all is OK.

    self.registration.showNotification(' Succesfully send to MongoDB');// this line is not working
   
    
    e.waitUntil( resp);


    
   
}

});

…….

What could be wrong?, in javascript side, It is verified that Notification.permission === ‘granted’.