Navigator.share

Dear support team, just testing my app on all browsers and found out that PDF files are not shared on navigator.share command, images are ok, movies ok, but no PDF.

Please fix asap, because many of my clients use samsung devices.

Regards,
George

1 Like

Hello,

Welcome to the Samsung Developers Forums.

Can you please share a code snippet or sample website where we can replicate the issue?

Sincerely,
Samiul Hossain
Samsung Developer Relations

Hi, I also faced this problem. While testing my app across various browsers, I discovered that PDF files are not shared using the navigator.share command in Samsung Internet. Images and videos work fine, but PDFs do not.

here is the code snippet

  const blob = await (await fetch(`data:application/pdf;base64,${base64}`)).blob()
    const file = new File([blob], `somepdf.pdf`, { type: 'application/pdf' })

    if (navigator.canShare({ files: [file] })) {
      try {
        await navigator.share({
          files: [file],
        })
      } catch (err) {
        alert(err)
      }
    } else {
      alert('cant share')
      console.log('Browser does not support sharing.')
    }

after that alert pop-up displayed a message

Hello, I faced this problem. When will it be resolved…? Other browsers are fine to work with.