Support » Plugin: Super Progressive Web Apps » Missing IOS head info and adding the WPA share API

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter onigetoc

    (@onigetoc)

    Here my minimalist working version. i create a shareapi.js file.
    I may create a function instead to call it when i want (For this project some things are called from ajax)

    jQuery(function ($) {
      //  $(document).ready(function(){
    
      let $shareon = $(".shareon");
      let $mobileshare = $(".mobileshare");
    
      if (navigator.share) {
        // alert('navigator.share');
    
        /* Hide old share selector for desktop and show the Mobile/PWA sharing api*/
        $shareon.css("display", "none");
        // OR replace the desktop sharing section and create the buton with javascript but we will need document.find selector for the on.click above
        $mobileshare.css("display", "block");
    
        $(".mobileshare button.shareIt").on("click", function () {
    
          // https://devendraverma.com/get-current-page-title-url-and-meta-description-using-jquery/
    
          navigator.share({
              title: document.title,
              text: $('meta[name="description"]').attr('content'),
              url: window.location.href,
            })
            .then(() => console.log('Successful share'))
            .catch((error) => console.log('Error sharing', error));
    
        });
    
      }
    
    }); // jquery function end
    
    //original basic // https://web.dev/web-share/
    //if (navigator.share) {
    //  navigator.share({
    //    title: 'web.dev',
    //    text: 'Check out web.dev.',
    //    url: 'https://web.dev/',
    //  })
    //    .then(() => console.log('Successful share'))
    //    .catch((error) => console.log('Error sharing', error));
    //}

    Hello @onigetoc

    Can you please share the website URL at which you have noticed that the Apple touch icons images are missing?

    So that I can take a look into the same and can get back to you.

    Looking forward.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Missing IOS head info and adding the WPA share API’ is closed to new replies.