Got a need to integrate Flickr support into your iPhone or desktop app? Well, here’s the open source project for you:
ObjectiveFlickr is a Flickr API framework designed for Mac and iPhone apps.
Yes, straightforward enough and you’d probably have googled it yourself if you need it, but we’d like to draw your attention to this interesting idea that might not have occurred to you about how to integrate web pages and iPhone apps:
…iPhone and iPod Touch posed a challenge to the auth model above: Opening up Mobile Safari then ask the forgetful user to come back is a bad idea.
So many iPhone developers have come up with this brilliant idea: Use URL scheme to launch your app. It turns out that Flickr’s web app auth serves the idea well. Here is how it works:
1. The app prompts user that it’s going to open up browser to ask for permission.
2. The user taps some “Open” button, and the app closes, Mobile Safari pops up with Flickr’s login (and then app auth) page.
3. Then magically, Mobile Safari closes, and the app is launched again.
4. There’s no Step 4.
What’s behind the scene is that the iPhone app in question has registered a URL scheme, for example someapp:// in its Info.plist and the app developer has configured their Flickr API key, so that when the user grants the app permission, Flickr will redirect the web page to that URL the app developer has previously designated. Mobile Safari opens that URL, and then the app is launched…
Well yippee, perhaps you are thinking, now when would I ever care to jump out to Safari and back when I’m writing an app?
Ah, let me tell you when you would care to jump out to Safari and back when you’re writing an app.
You could care to do that if you write an app that loads up a web page to make a donation in a UIWebView, and when you send your shiny new app off to Apple, BRRRRAAAANNGGG it bounces back with
Thank you for submitting [REDACTED] to the App Store. We’ve reviewed [REDACTED] and determined that we cannot post this version of your application to the App Store because it does not adhere to the charitable requirements outlined in the iPhone Developer Program License Agreement …
… Donations are not permitted to be taken within the application, however it is possible to provide a donation link to your web site. This link is required to open Safari to collect the donation. We encourage you to make the necessary changes to your application and resubmit it for review.
Well, the license doesn’t say it has to open in Safari, it just says “a direct link to a page on Your web site”. And that’s exactly what was in the UIWebView, @#($@^#$^!!! it. So we duly complied and resubmitted, but it makes the experience significantly more annoying. But if this clever stratagem had occurred to us, we could have had the opened-in-Safari page open back up the triggering application. That would have made for a happier client!
Continue Reading →