How to share message from reactjs app on Snapchat web

160 Views Asked by At

I was trying to share message from my reactjs app to Snapchat Web, but did not succeed. For exp: I have a button Share On Snapchat, once clicked, it should open Snapchat web and allow me to select any of my contacts and send message like "Hello world", this message must be from reactjs app.

I have tried - but still could not succeed.

I will be so much thankful for any help you could do.

Here is what i have tried

    <button
          className="snapchat-share-button"
          data-share-url={process.env.REACT_APP_WEBSITE_URL}
          onClick={handleSnapchatShare}
        >
          Snapchat
        </button>

And handler is

  const handleSnapchatShare=()=>{
    const message = 'Hello, this is a message shared from my app!';
    const deepLink = `https://web.snapchat.com/1e543384-8ee4-5283-99e7-dd07628700a2?attachmentUrl=${encodeURIComponent("https://i.dummyjson.com/data/products/10/3.jpg")}&caption=${encodeURIComponent(message)}`;
    window.location.href = deepLink;

  }

REACT_APP_WEBSITE_URL is public URL and is valid.
It opens Snapchat web, but it always asks to download snapchat app - How can i download snapchat for desktop because it shows following Interface with login option for desktop

enter image description here

It just get's me to snapchat web and i have nothing to share - no message there.

0

There are 0 best solutions below