Facebook App Error 191: URL not owned by Application – try this…
posted by robert | filed under Facebook App Dev, tutorials/samples
I’ve recently had feedback from one or two “Facebook Application Development” course students who’ve ran into the infamous “error 191″ problem when trying to run their Facebook Apps.
Normally this error is caused by using an incorrect URL in the ‘redirect_uri’ parameter for getLoginUrl when using the PHP SDK, for example:
$loginUrl = $facebook->getLoginUrl(array('scope'=> 'user_checkins','redirect_uri'=> $app_url));
Another potential cause of this error is mixing your http: and https: URLs or assigning a http: URL to this parameter when the user is actually using a secure https: URL to access your App.
When I recorded the Facebook course the need to check the protocol and assign the correct http: or https: URL simply wasn’t there. Now we need to do this. Many users have switched over to using Facebook over a secure connection and Facebook will also switch off support for http:-only Apps anytime soon (as usual, no exact date).
Here’s a little snippet you can use to check for the protocol being used and assign the ‘redirect_uri’ correctly:
$protocol = ($_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
Then simply prepend $protocol to your ‘apps.facebook.com/…’ string to form the URL.
If that’s not the issue and all seems to be fine, all URLs look right and you simply can’t see what else could be wrong, then don’t panic: Stop pulling your hair out
Have you set up an App Namespace in the Developer App?
It turns out that, if you don’t set this and use the APP NAMESPACE to refer to the App, you can get the dreaded 191 error. Set it and use it in your redirect_uri instead of the FB-generated App ID number.
When I recorded the course, the App Namespace was generated and used by default to reference the App. Hence the problem didn’t arise. This is one of the things that have changed since the course was recorded.
To summarise:
- Check that your URLs and protocols match – both in the Developer App and in your code.
- Assign the correct protocol when assigning the ‘redirect_uri’ parameter for getLoginUrl().
- Use the App Namespace and not the App ID to reference your App on apps.facebook.com
There have, of course, been many more changes in the World of Facebook App Dev since I recored the course – even since it’s release. Watch this space for more updates over the next few weeks!
Happy Facebook App-building!
tags: facebook, Facebook SDK, video course, video2brain, workshops
iPhone and iOS 5 Advanced App Development – inside the box
posted by robert | filed under iDevices/iOS, tutorials/samples
In addition to being available online, my video2brain iPhone and iOS 5 Advanced App Development: Learn by Video course is also available to purchase in DVD form
For those of you who haven’t seen how these physical media courses look I’ve taken a couple of photos:
The DVD is packaged rather neatly with an flap on the back of the package. Open the flap and you’ll find a window that reveals the DVD itself and also an accompanying 48-page booklet which contains extra material in addition to that covered by the course. The booklet for this course covers the top features of iOS 5 for developers and also contains a chapter full of tips and advice on testing, preparing and marketing your app – something I felt was important to include with the course.
The booklet also contains important information to help you get the most out of the course and is very nicely finished off, easy to read:
So, as you can see, owning the course on DVD brings with it the bonus of extra material in the form of the booklet – 48 pages of content designed to complement and extend the course material – all written by yours truly!
Pop over to Amazon and get yours today! The link is in the sidebar to the right!
Happy reading!
tags: iOS 5, iPad, iPhone, Objective-C, video course, workshops, XCode






