I can't display my app on facebook - php

I'm having a little problem with the whole Facebook app development.
I created an facebook application and gave it an IP for my server.
I set my .php script file on the server and set the secret key and appId.
When I click on the app on my Facebook account to reach it, I get an "Uploading (0%)" text on the bottom of the browser and eventually I get a message:
"This webpage is not available".
When I used the "Heroku" hosting service, I got an app.
I think the problem is the communication between Facebook and my server but I don't know what.
I tried almost everything.
Can somebody help me?

If you issue a request to your application from the linter tool?
http://developers.facebook.com/tools/debug
If you run your own application url through there and don't see any activity then Facebook just cant access your server and you need to do some work with your firewall.

Related

Triggering Azure WebJobs API over Basic Auth from external PHP app?

As per the title - I'm trying to trigger an Azure Website "triggered" WebJob from our custom PHP deployment application hosted external to Azure websites.
Thanks to what I believe is Active Directory, I'm able to navigate the /api URLs in my browser and get a JSON output without having to reauthenticate. For example, /api/triggeredwebjobs outputs the triggered WebJob information (that I've set up inside Azure Portal) in my browser.
I've gotten as far in my PHP app as sending a POST request and it is successfully authenticating using basic auth, but every single /api URL that I set in my PHP app returns:
"No route registered for '/api/triggeredwebjobs/{webjobname}'"
where {webjobname} is my custom name for the web job, hidden for privacy of the client. Every URL returns this, but if I navigate in my browser, I only get that error if I navigate to a URL that doesn't exist, such as /api/blahblahblah.
I've set up a deployment user which is what it's using to authenticate... I've even logged in to https://{azuresite}.scm.azurewebsites.net/basicauth using the deployment user and successfully gotten output from each /api page in my browser.
If it helps, I'm using Httpful.phar to handle the HTTP requests.
Thank you very much for taking the time to read and possibly assist.
A colleague helped me get to the bottom of this - the documentation was out of date. I have opened an issue on the Kudu Github Repo to get them to review this:
https://github.com/projectkudu/kudu/issues/1466
To solve the issue for future readers of this question, the correct URL to use within the requester app is:
https://{yoursite}.scm.azurewebsites.net/jobs/triggered/{jobname}/run
Good luck!

Developing a Facebook canvas app locally - (MAMP, Codeigniter)

I am starting my first Facebook app, hosted on Heroku. I have set up an app on Heroku for production and a separate app running locally on my own machine for development. Currently, the app (which has very little functionality) runs on localhost just fine. But I don't understand if the app should be able to run like a typical canvas app on the localhost with Facebook functionality. For example, will the Requests Dialog run in a canvas app locally. Should I be able to use that functionality locally as I develop? If so, what steps do I need to take to get that working?
The differences
The only real difference between a standalone site and a canvas app (or page tab) you'll see is that you won't have a signed_request passed in when you load your page.
App dialog will still work, but in popup instead of directly on the page. Plus, you'll be able to login user like you would if you set your local dev URL (eg http://localhost:5000) in the Facebook app settings under "Website with Facebook Login" (or mobile web).
There's also some stuff you won't be able to test on the server like realtime update where facebook send a request to your site to notify an update.
There may be some other things, but this is what I can think about right now.
Working locally
So, what I usually do, is develop it locally. To manage the missing signed_request, I only provide a stub one or I just don't count on it being present so my app can run out of facebook too.
For login methods, I tend to rely only on the JS SDK as most of server side login through a canvas app will rely on the signed_request - and enaway, I found the UX login better via the JS SDK.
Then, I only setup two FB app, one staging and one for release. The staging app point to my locals urls so my Facebook will allow connection from it.
At this point, it should mostly work fine out of the box!
But I don't understand if the app should be able to run like a typical canvas app on the localhost with Facebook functionality
Your app should behave the same way whether it is on localhost or on the final production server.
Facebook dialogs (requests, messages..) should display on your local (dev) machine as they do on the live server. In my case to make this work I setup a secondary "facebook app" with different values for App Domains, Site URL and Canvas URL.
This allows you to run your app from localhost. If you app is canvas-only it will run inside an iframe (which points to Site URL) but will be displayed within Facebook.
Also, make sure you're including Facebook's JS API if you want to see any of the Facebook modal boxes rather than pop-up windows.
The only difference you should notice is that if you share a page from your localhost dev site via the FB API, Facebook won't be able to crawl your site and get any icon, image or description should it need to.

'An error occurred. Please try later' message on Facebook authentication dialog

I am a newbie who is trying to create a Facebook app using PHP and Facebook's PHP SDK. The app is hosted on Heroku, and the sample app that they provided is working fine. However, I am now trying to get the sample app to work on Apache 2.2, and I have encountered a lot of problems along the way. Well, straight to the point, my latest problem will be trying to do Facebook login on localhost, but the 'An error occurred. Please try later' appears on the popup dialog. This does not happen on Heroku.
Will someone please enlighten me on if there's any steps that I can take to overcome this error? I don't think it got to do with any coding error since I am just following the provided sample app. Thanks!
This is happening because FB does not recognize the URL of the host issuing requests. You need to determine what the FQDN of your localhost server is then add it to the Site URL section of the FB App Settings manager. Chances are you have the URL of your Heroku server in there now.
its simple. in local host you must create another sample application for localhost in facebook .and you must have the permission.then you can login and work with your local one.
simply for every copies of your app.you must create it in facebook
hope it help you
good luck

App on Facebook

I'm trying to run the example.php file that comes with the facebook sdk. I do have a hosting server that runs php, and also changed the ID's to the corresponding one on my app. Here is the message i'm getting:
This webpage is not available
The webpage at https://filipeximenes.com/facebook/ might be temporarily down or it may have moved permanently to a new web address.
Error 501 (net::ERR_INSECURE_RESPONSE): Unknown error.
i'm pointing the canvas to this adress: http://filipeximenes.com/facebook/
Thanks.
Based on your description, I think that this is your problem:
Do you have a valid security certificate on the hosting server? I ran into that problem recently when deploying an FB app. Since October, you have to have a valid cert even in sandbox mode for the FB app to run properly. If you don't have one it causes weird problems.
Just a thought that I hope helps.
One other thing to do from a debugging perspective is to take a look at the actual app running on your hosting server without viewing it via FB. If you get the same error message there, you know that it has nothing to do with the FB SDK.
Thanks!
Matt

Facebook Connect - Mobile

I am currently in the process of creating a mobile version of my web app.
The app is being developed with Facebook's PHP Client Library.
The issue:
I am using the following mobile url to allow users to log in using the mobile devices:
http://m.facebook.com/tos.php?api_key=APIKEY&v=1.0&next=http%3A%2F%2Ftweelay.net%2Fm.php&cancel=http%3A%2F%2Ftweelay.net%2Fm.php
APIKEY being my app's actual Facebook API key.
In the url I am telling Facebook to redirect the user back to http://tweelay.net/m.php when the user signs in or clicks cancel on the log in screen. I am pulling my hair trying to figure out why it keeps sending the user to http://m.tweelay.net/m.php which is currently an invalid end point.
I have gone through all of my app's settings on Facebook and I cant find any that reference http://m.tweelay.net and going through all of my source code I cant find any that reference the m. sub-domain either.
Any ideas? Is there a setting I'm missing? Maybe a Flag in the library?
I've seen Facebook do this when detecting the mobile browser type and also sometimes randomly through Firefox (it can also happen when trying to get to facebook.com). I've managed to reset it sometimes, but it's not a guaranteed fix.
If you want to be sure the user makes it to your correct site I suggest creating the subdomain and redirecting traffic to your usual site, it's what I did and now I don't worry about it reverting back.

Categories