26

I give my production server IP address as App domain in facebook application but it's not saved. It returns error as App domain is not valid. So that I cannot use my facebook connect API.

Can we give IP address as App domain in FB application? If it's not, what is the other way to do?

Jordan Arnesen
  • 413
  • 5
  • 10
name-it
  • 2,238
  • 3
  • 19
  • 28
  • Are you sure the domain isn't marked as spammy in Facebook's systems? if it is you won't be able to share a link to that URL either – Igy Feb 17 '12 at 16:07
  • yes...Its not marked spam by fb... I added server IP address as App domain but that returns error as invalid domain.can we add IP addreess as App Domain in Facebook Connect Application? – name-it Feb 17 '12 at 16:40
  • I have the same problem. It seems that FB doesn't accept IP address as a domain name. – emeraldhieu Jul 24 '12 at 08:03
  • you should accept nitzan's answer as the correct one, @Rajapandian. – tony gil Feb 02 '13 at 10:45

5 Answers5

14

No, it looks like the app domain can only be a domain and not an ip address.

For example in the app settings page, near the App Domain hover the '?' and see:

Enable auth on domains and subdomain(s)

Also, I found this page: http://developers.facebook.com/docs/appproperties/ it refers to the REST api and so it's not that up to date, but it clearly states there that there are two different properties: base_domain(s) and ip_list.

I suggest that you try to put a normal domain and see what happens.

Nitzan Tomer
  • 155,636
  • 47
  • 315
  • 299
  • @all thanks.. it wroks with domain name.Not working with the IP address.I think we cannot add IP address as domain.. – name-it Apr 06 '12 at 13:34
  • 3
    No you can't, you can only use domain names. – Nitzan Tomer Apr 06 '12 at 13:37
  • 2
    Lame... Amazon payments requires me to use 127.0.0.1, but Facebook requires me to use localhost. So, no matter what, part of my dev environment will be broken. – Jargs Nov 26 '13 at 21:18
  • Well, you can use a trick: load the main page from the IP (like amazon requires) and have an iframe which loads the FB sdk from localhost. I'm not sure if you'll be able to communicate between window/frame (probably not), but you can use `window.postMessage` between them. Not an ideal solution but should work none the less. – Nitzan Tomer Dec 30 '13 at 19:29
12

All Wrong answers. Here is the true

You must click (+ add platform)

then Select Platform choose app I select website the planet icon

Enter Site URL http://www.yoursitehere.com Mobile Site URL http://www.yoursitehere.com

go back and enter in App Domains: yoursitehere.com

now click save

go to Status and Review Do you want to make this app and all its live features available to the general public?

change or move to (YES)

user3251398
  • 241
  • 2
  • 2
  • 11
    This is a generic answer for adding domains, which is not what the question is about. The OP is asking how to set this up to work with IP Addresses, not domains. – Jordan Arnesen Aug 08 '16 at 23:23
8

One solution to getting over the problem of using an IP address as a valid domain is to use: xip.io

xip.io is a magic domain name that provides wildcard DNS for any IP address

Simply add .xip.io after your url and use this as the domain name. Perfect for me as I do my development on a virtual machine!

LeDoc
  • 935
  • 2
  • 12
  • 24
8

This is what I found works.

  1. From the Facebook development page "Apps-YourAppName", click on Basic in the LEFT Nav.

  2. There are 3 sections on this page: Basic Info, Cloud Services, and "Select how your app integrates with Facebook"

  3. In the Select how your app integrates with Facebook section, select "Website"

  4. Enter your fully qualified domain name in the Site URL dialog box. Example: http://www.mydomain.com OR http://mydomain.com (my site does not include the www so I didn't add it).

  5. At the bottom of the page click the "Save Changes" button. You may receive a notice that it may take several minutes to blah blah blah....but you can continue with the next steps immediately.

  6. Now, in the Basic Information section at the top of this screen, you can now add your App Domain. This should be formatted as mydomain.com. Do not add "http://" and do not add "/" at the end of the domain name.

  7. NOTE: My site does not use the www, so I cannot confirm that it's required in Step #6. Try it both ways if you're unsure.

  8. At the bottom of the page click the "Save Changes" button. You may receive a notice that it may take several minutes to blah blah blah....but you can continue with the next steps immediately.

  9. At this point the error was NOT displayed as it was before.

Hope this helps!

Nicole Paul
  • 125
  • 3
  • 4
    Regarding step 6.: Adding an *IP address* (versus *domain name*) still doesn't seem to work for me. – Abdull May 30 '13 at 13:31
4

If you don't have a domain (only the IP) just leave the "App Domains" field in blank. It works! =)

This, IMHO, is Facebook's fault as the error message is really confusing and makes you think only domains are allowed.

Hope it helps someone! =)

  • This works, but I had to make sure to fill in the "Website with Facebook Login: Site URL" field with http[colon]//ip.add.re.ss to get it to work. – Jargs Nov 26 '13 at 21:22