SampleCode

Latest

  • Google API hopes to help iOS app links open in Chrome

    by 
    Steve Sande
    Steve Sande
    07.13.2012

    Google's Chrome browser for iOS has a lot of features to love, but unfortunately for most of us who use it, we still find that clicking a link in another app only opens that link in Safari. Google is hoping to rectify this issue by providing developers with sample code that checks whether or not Chrome is installed on an iOS device, and then adds an option to open links with it when it is installed. The Verge notes that this is similar to adding an "open in Dropbox" option to a Word or PDF document in an app. Hopefully a lot of iOS devs will choose to add the necessary code to their apps so that doing something as simple as tapping a link in Twitter gives users the option of opening that link in Chrome.

  • What was GameStore? Looks like sample code

    by 
    Erica Sadun
    Erica Sadun
    01.02.2012

    Earlier today, Kelly posted about GameStore, a new Apple app that appeared on the App Store right before the New Year and was pulled several minutes ago. I forked over my dollar and downloaded a copy to see what the app was all about. It turns out, that there wasn't a lot of there there, and what there was looked an awful lot like...sample code. Specifically, sample code that demonstrates how to perform in-app purchases. The application's identifier was com.apple.iphonesdk.GameStore. Compare this with com.apple.Cards, the identifier for Apple's Cards app. "iphonesdk" hints that the application was meant for developer audiences, i.e. users of the iOS Software Development Kit. Next, I looked at the contents of the application bundle. Therein I found numerous listings for consumable and non-consumable items. These included things like "Awesome Sword" and "Consumable Bullets" as well as the less descriptive "sku.gamestore.nonconsumable.item1." All the classes in the app consisted of such generic elements as "MyProduct," "StoreEngine" and "ProductInfoViewController." Basically, it looked like sample code. Adding to this hypothesis is the tab called "PaymentQ." The queue is of deep interest to developers and absolutely of no interest to end-users. So how did this app end up on the App Store? I have an hypothesis. As I point out in my developer cookbook, although you can easily add IAP features to applications that are already for sale on App Store, you cannot fully develop and test your in-application purchasing for new apps without submitting your application to iTunes. What developers do is upload a working skeleton application to iTunes Connect. You do this with the full understanding that you'll be replacing or, for tutorials, rejecting your binary at some point in the future. Once uploaded, you can test your IAPs, and make sure all your purchasing processes work. Looks like the app was submitted in order to provide a live testbed and may have gotten approved inadvertently. After consulting with the TUAW team, our take on this is "likely sample code accidentally deployed to App Store" by Apple and then quickly pulled once people took notice. TUAW reached out directly to the developer we suspect was behind the app upload before it got pulled.

  • iPhone Orientation: Apple Sample Code

    by 
    Erica Sadun
    Erica Sadun
    12.20.2007

    Apple has posted sample code demonstrating how to handle iPhone or iPod touch orientation events through JavaScript, HTML, and CSS. Whenever an iPhone rotates, it triggers orientation events that you can catch in Mobile Safari. Apple provides a sample iPhoneOrientation.js file that implements a typical handler, window.onorientationchange. CSS attributes can dynamically change how the webpage appears. I loaded a copy of the sample over at my website. If you'd like to give it a try on your iPhone, navigate here. Thanks, syd