javascriptangularfacebook-javascript-sdk

FB sharing using feed give href not found error on providing a specific path of website( https://www.website.in/me) to share)


i am trying to integrate sharing via facebook feed to our website using ngx-facebook.facebook. share as feed works when i share the websites domain name only

ie.,

https://www.website.in (works)

but it's not working a specific url of website

https://www.mywebiste.in/view-profile/123 (not working )

since iam migrating our php website to angular i have checked our previous websites for confirmation .

there it works perfectly

    const options: UIParams = {
    method: "feed",
    link:'https://www.mywebsite.com/listen',
    };

    this.fb
      .ui(options)
      .then((res: UIResponse) => {
        console.log("Got the users profile", res);
    })
    .catch(this.handleError);

Solution

  • Actually the share link ( iam sharing a link to a users profile through fb,whatsapp,mail options) is getting from our backend through api.

    (www.wbs.com/profile/view/7x5j) and sharing as feed not working when i passed above as link.

    to add more to my confusion

    And the same link is working for whatsapp sharing and mail sharing

    so i hardcoded the our website's domain and with it sharing as feed worked properly in local host.

    and i hardcoded the coming link also for testing but it didn't work in localhost

    after some experiment i found out it didnot work for me because of extra white space at the end of link ( when i trimmed the link for removing white space i was able to share as feed )