Facebook share and check if shared

Asked

Viewed 314 times

0

I put a share button, it opens a new window to share what I set, and if shared I do an action, if not shared, I do another action.

However, gives an error in this new window, Facebook itself:

Unable to load URL: The domain of that URL is not included in the application domains. To load this URL, add all domains and subdomains to the Application Domains field in application settings.

I’ve seen, I’ve checked on my facebook app, my consensus is all right.

This is basically the code I’m using(See Jsfiddle is running exactly as I set it in my test environment):

https://jsfiddle.net/ezL1un3v/

Any information, request, really need to solve this problem.

1 answer

1

The href in your code is to www.google.com, I believe this is the problem. Your Facebook app can only use the domains you set up on it, to add domains you must access your app on https://developers.facebook.com/apps/ and go into configurações on the menu.

Scrolling below you will find this screen inserir a descrição da imagem aqui

I believe you will need to check your domain(s), you probably will not be able to reference third party domains.

  • Thank you for the reply.

  • Certainly I made the configuration for Google! I switched now to preserve the site from the production environment, so I put the Google. Yes, the settings set 'URL' to http://www.google.com/

  • 1

    @Alexandrec.Caus makes a test by calling the function without the attribute href, so will be used the default value that is the URL itself in which you are, if it works means that the URL you passed to the href is the problem. Maybe it’s just because you haven’t added one subdomain.

  • I will take the test, I will edit on jsfiddle itself. I took the test: Accused 'The Parameter href is required'

  • Here is the current configuration available on Facebook: http://ap.imagensbrasil.org/image/jqwObU

  • True, when using the method share it is mandatory, the error message keeps leading me to think that the `href``is the problem, I would try to put the purest possible url (no sudomains) of the domain you are in and that is sure it is configured in the app. But I can’t imagine another problem that might be happening.

  • @Alexandrec.Caus, based on the photo you submitted, tries to change the google url to the one of the domain that is the site, and to reference your site on href. To test. I’m pretty sure that the URL you set up there should be a domain you own, not a third party domain.

  • Because it is, as there is no check or authenticate the URL to show that the domain is its own, as on Youtube there is (to put clickable URL in the video), I do not think that using third-party urls is in fact the problem.. Edit: I’ll do the test you indicated.

  • @Alexandrec.Caus Even if you can use the third-party URL there, I’m pretty sure your domain URL that you’re using the app should be there as a security feature.

  • Well, I put the production URL, I adjusted it on facebook to production URL and I tested it on the production URL (not on localhost but on the website itself), and still the error persists.

  • Lucas, it worked now. Well, I didn’t suspect that the solution could be that simple, nor did I know that it made any difference (actually, if you can tell me why, tell me!): In the domain field of the app, you should put which domain is authorized to use your app, basically if you indicate www.xx.com, the site xx.com is not authorized. you need to indicate both xx.com and www.xx.com... The bloody www makes a difference, it seems that there is the possibility of being a different version of the site. What do you think of this behavior?

  • If there is a possibility of different versions with www, and without www, then that is fair. So much so that on the Google console, when you associate a website, it asks you to add the version with and without www... In my consent is the same site, but I saw that may be a different version, will be true?

  • @Alexandrec.Caus, glad you could make it!!! There is the possibility that the site without and with www are different versions, of course it would be confusing for the user but in terms of DNS are different. the www works as one of the possible domains of your main domain. 301 redirect on your website, take a look at this article.

Show 8 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.