Skip to Content

devsugar: Farewell, UIGetScreenImage()

Last December, Apple relented on the use of the otherwise private UIGetScreenImage() API. This function allows iOS developers to capture a screenshot on a device, regardless of the contents of the screen. In contrast, the standard SDK-safe approach to screen captures ([theView.layer renderInContext:context]) did not allow applications to access video layers, camera previews, or some OpenGL content.

iOS developer Manfred Nerurkar writes on his blog that he was just called by his Apple Developer Relations contact and told that Apple has made an about face on this issue. Apps using UIGetScreenImage will no longer be greenlit for the App Store. Instead, developers will need to use standard Quartz methods (as mentioned aboved) or migrate their camera capture code to AVFoundation.

As Nerurkar points out, this decision will force developers to refactor their code and, in doing so, limit screen capture to iOS 4.0 or later deployment. iPhone 2G users will not be able to use camera-centered utilities as iOS 4 AVFoundation functionality cannot be included on the earlier platform. Any 3G and 3GS users who have not upgraded from iOS 3.x will also be affected. That means that Nerurkar's iCamcorder and iWebcamera will lose a large part of their audience.

Nerurkar's Drahtwerk firm is not the only one affected. Popular scanner apps such as Occipital 's Red Laser (now bought out by eBay) have a large early model/slow adopter iPhone user base, and if they have to be updated to use the newer methods they will be leaving those users behind.

More discussions are ongoing at the Apple developer forums (behind the paid dev firewall).

Categories

Bad Apple

Last December, Apple relented on the use of the otherwise private UIGetScreenImage() API. This function allows iOS developers to capture a...
 

Add a Comment

*0 / 3000 Character Maximum

19 Comments

Filter by:
Forrest

Only 4.0+ can use AV SDK, then 1 generation iPhone will not use it forever ? iPhone 3G can upgrade to 4.0, but I am the jailbreak ones, cannot upgrade now. Bad thing is that one camera app (mine ) will face rejection soon. Wow,bad thing !

July 22 2010 at 3:46 AM Report abuse rate up rate down Reply
Unregistered

Will existing apps in the app store be yanked if they do not update it to remove the UIGetScreenImage() API call?

If they are allowed to remain then perhaps it would be easier to release another version of the same app with update apis called eg, Red Laser for iOS4

July 21 2010 at 11:20 PM Report abuse rate up rate down Reply
Ian

Agreed. I'd say this is the exact thing they are moving to prevent.

July 21 2010 at 5:43 PM Report abuse rate up rate down Reply
1 reply to Ian's comment
Ian

Oops. This was in response to @KevMo

July 21 2010 at 5:46 PM Report abuse rate up rate down Reply
KevMo

my guess is that it's a security issue with multitasking. If an app can call UIGetScreenImage() while it's in the background, any information in the foreground app can be captured.

July 21 2010 at 4:41 PM Report abuse rate up rate down Reply
Farris

Well this sucks. I've had my 3G for exactly 1 year (actually, today is my one year anniversary, woot), and I'm downgrading right now to 3.1.3 due to the extreme bugginess of 4.0 on a 3G.

I bought RedLaser and iCamcorder... Now that I'm downgrading because the latest firmware sucks, neither one will work? Boo Apple. My next phone will more than likely not be an Apple product. I love my phone, but needing to reboot it daily to keep the iPod app from skipping when I send texts or having to click the Facebook app up to 4 or 5 times to get it to actually open without crashing is getting ridiculous.

July 21 2010 at 2:17 PM Report abuse rate up rate down Reply
3 replies to Farris's comment
frank.lowney

Is this not the same function used by ScreenSplitr and Display Recorder? As I understand it from http://www.plutinosoft.com/category/all, there was some hope that these apps would become "legit."

The accountants won't let us spend money on apps for jailbroken devices so this is a disappointment for those of us who need to do live demos and screencasting for training and support in educational settings.

July 21 2010 at 1:50 PM Report abuse rate up rate down Reply
Frank Ewell

I love RedLaser. I use it often on my 2G iPhone. It would be tragic to lose this app.

July 21 2010 at 12:58 PM Report abuse rate up rate down Reply
err404

Apple originally allowed the use of an otherwise private API because comparable functionality did not exist in the public libraries. These functions have been added to iOS4 so Apple is removing the exception. Apps already approved in the store are grandfathered in, but all new versions have this restriction. This sucks for iPhone 2G and 3G users (since iOS4 run poorly), but is probably the right move by apple to ensure a streamlined dev process.

July 21 2010 at 12:12 PM Report abuse rate up rate down Reply
Matt Lemieux

Has Apple not said explicitly on more than one occasion "Do NOT use private APIs"?

That said, Apple's hideous mistake here is allowing them to get away with it in the first place?

July 21 2010 at 11:57 AM Report abuse rate up rate down Reply
2 replies to Matt Lemieux's comment
jh

This kind of stuff would never have happened at Microsoft. Course, if you used private API stuff at Microsoft, and then it changed, they wouldn't have developer relations people call you AT ALL.

You'd just find out that your code no longer works. And that there's no way to refactor it. And that you get to change thousands of lines of code :P

Oh, and you'll find this out hopefully in test, and not before a customer uses it.

July 21 2010 at 12:14 PM Report abuse rate up rate down Reply
JKT

What part of "there's no other way to do this" don't you understand? The old "don't use private API's" makes little sense if there's no published way to accomplish the task.

July 22 2010 at 6:00 PM Report abuse rate up rate down Reply
DYLAN UNUTMAZ

OH! it all makes sense now

July 21 2010 at 11:45 AM Report abuse rate up rate down Reply
Buy an ad here

Hot Apps on TUAW

Tweets

© 2012 AOL Inc. All Rights Reserved.