<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>George MacKerron: code blog &#187; iPhone</title>
	<atom:link href="http://blog.mackerron.com/category/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mackerron.com</link>
	<description>GIS, software development, and other snippets</description>
	<lastBuildDate>Fri, 03 Feb 2012 18:35:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Passcode view controller</title>
		<link>http://blog.mackerron.com/2011/10/28/passcode-view-controller/</link>
		<comments>http://blog.mackerron.com/2011/10/28/passcode-view-controller/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 16:33:25 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://blog.mackerron.com/?p=511</guid>
		<description><![CDATA[Need to protect something with a passcode in an iPhone app you&#8217;re developing? Then you may find my MIT-licensed passcode view controller &#8212; as seen in the mappiness app and in the short screencast below &#8212; of use. See Github for the code and (scant) documentation. Download video as MP4, WebM, or Ogg.]]></description>
			<content:encoded><![CDATA[<p><strong>Need to protect something with a passcode in an iPhone app you&#8217;re developing?</strong></p>

<p>Then you may find my <span class="caps">MIT</span>-licensed passcode view controller &#8212; as seen in the <a href="http://www.mappiness.org.uk">mappiness</a> app and in the short screencast below &#8212; of use. </p>

<p>See Github for the <a href="https://github.com/jawj/PasscodeViewController">code and (scant) documentation</a>.</p>

<video width="292" height="622" controls="controls"><br />
  <source src="/wp-content/uploads/2011/07/Passcode1.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'><br />
  <source src="/wp-content/uploads/2011/07/Passcode1.theora.ogv"  type='video/ogg; codecs="theora, vorbis"'><br />
  <source src="/wp-content/uploads/2011/07/Passcode1.webm" type='video/webm; codecs="vp8, vorbis"'><br />
  <object width="292" height="622" type="application/x-shockwave-flash" data="flowplayer-3.2.1.swf"> <br />
    <param name="movie" value="/wp-content/uploads/2011/07/flowplayer-3.2.7.swf" /> <br />
    <param name="allowfullscreen" value="true" /> <br />
    <param name="flashvars" value='config={"clip": {"url": "/wp-content/uploads/2011/07/Passcode1.mp4", "autoPlay":false, "autoBuffering":false}}' /><br />
    <p>Download video as <a href="/wp-content/uploads/2011/07/Passcode1.mp4"><span class="caps">MP4</span></a>, <a href="/wp-content/uploads/2011/07/Passcode1.webm">WebM</a>, or <a href="/wp-content/uploads/2011/07/Passcode1.theora.ogv">Ogg</a>.</p>
  </object><br />
</video>]]></content:encoded>
			<wfw:commentRss>http://blog.mackerron.com/2011/10/28/passcode-view-controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Four things I&#8217;ve learned using Push Notifications</title>
		<link>http://blog.mackerron.com/2010/09/11/4-things-apns/</link>
		<comments>http://blog.mackerron.com/2010/09/11/4-things-apns/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 14:32:06 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.mackerron.com/?p=386</guid>
		<description><![CDATA[My current iPhone app/research project, mappiness, is heavily reliant on Apple&#8217;s Push Notification Service (APNS). We&#8217;re now sending about one million notifications a month, and it&#8217;s working beautifully. The obvious alternative &#8212; using SMS messages &#8212; would be costing us tens of thousands of pounds a month. If you&#8217;re using or contemplating using Push Notifications, [...]]]></description>
			<content:encoded><![CDATA[<p>My current iPhone app/research project, <a href="http://www.mappiness.org.uk">mappiness</a>, is heavily reliant on Apple&#8217;s Push Notification Service (APNS). </p>

<p>We&#8217;re now sending about one million notifications a month, and it&#8217;s working beautifully. The obvious alternative &#8212; using <span class="caps">SMS </span>messages &#8212; would be costing us tens of thousands of pounds a month.</p>

<p>If you&#8217;re using or contemplating using Push Notifications, you may find these four points of interest:</p>


<ol>
<li><a href="http://urbanairship.com">Urban Airship</a> offer a well-though-out and reliable service. But if you&#8217;re using them just as an intermediary in telling the <span class="caps">APNS </span>to beep users X, Y and Z right now &#8212; not making use of their scheduling or broadcast features, for example &#8212; it might well not be worth it. You&#8217;ll cut out a layer of indirection, and save money if you get big enough for it to matter, by talking to Apple directly.</li>
<li>There&#8217;s a surprising dearth of viable-looking open-source options for interfacing with the <span class="caps">APNS. </span>(APNS uses a binary protocol over a secure connection, and doesn&#8217;t like this connection torn down and reopened too often, so you can&#8217;t easily interface with it directly from a web app or cron job). But there is <a href="http://pyapns.org/">pyapns</a>, an <span class="caps">XML</span>-RPC-speaking <span class="caps">APNS </span>provider built on Python&#8217;s Twisted networking framework, with client libraries for Python and Ruby. I&#8217;ve found this straightforward and rock-solid.</li>
<li>The <span class="caps">APNS </span>feedback service sometimes reports device tokens as inactive for no obvious reason, so make sure you&#8217;re prepared to hear from and reactivate users you&#8217;ve previously inactivated. (mappiness got bitten by this early on: a few dozen people were unable to authenticate to our server because they&#8217;d been reported as inactive and we&#8217;d assumed they were never coming back, despite that fact they had the app installed and Push Notifications switched on).</li>
<li>The app delegate method <code>application:didRegisterForRemoteNotificationsWithDeviceToken:</code> seems occasionally to return phantom zero-length device tokens &#8212; so don&#8217;t let your app or server get flummoxed by these. (We suffered from this on mappiness too: the bad device token got added to the front of a queue for sending from the app to our server; the server wouldn&#8217;t accept it; and this blocked all further data getting sent back until we fixed the server to silently ignore the bad tokens).</li>
</ol>

]]></content:encoded>
			<wfw:commentRss>http://blog.mackerron.com/2010/09/11/4-things-apns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>O2 mobile broadband on a Mac: tips for you, suggestion for O2</title>
		<link>http://blog.mackerron.com/2009/08/01/o2-mobile-broadband-on-a-mac-tips-for-you-suggestion-for-o2/</link>
		<comments>http://blog.mackerron.com/2009/08/01/o2-mobile-broadband-on-a-mac-tips-for-you-suggestion-for-o2/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 12:52:50 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://blog.mackerron.com/?p=158</guid>
		<description><![CDATA[Until Monday, O2 is offering a half-price USB dongle for pay-as-you-go mobile broadband. Buy it via Quidco, and you get not only the dongle but also a month&#8217;s access (or 3GB, whichever is the sooner) absolutely free. So: free modem. No further commitment. And the opportunity to buy access a day at a time for [...]]]></description>
			<content:encoded><![CDATA[<p>Until Monday, O2 is offering a <a href="http://shop.o2.co.uk/promo/o2mobilebroadband/tab/Pay_and_Go">half-price <span class="caps">USB </span>dongle</a> for pay-as-you-go mobile broadband. <a href="http://www.quidco.com/o2">Buy it via Quidco</a>, and you get not only the dongle but also a month&#8217;s access (or 3GB, whichever is the sooner) absolutely free.</p>

<p>So: free modem. No further commitment. And the opportunity to buy access a day at a time for &#163;2, on a train journey, for example, or in an airport lounge, where the cheapest paid-for WiFi option is rarely less than &#163;5, and often nearer &#163;10. Handy.</p>

<p><strong>Update. O2 is no longer doing the modem at half price, but the Quidco cashback has increased so that it still fully covers the modem and a &#163;15 top-up.</strong></p>

<p><span id="more-158"></span></p>

<h3>The dongle</h3>

<p>The dongle, a Huawei <span class="caps">E160, </span>is a fairly pretty white thing, and it supports my Mac. So far so good. Unfortunately, the software and instructions have <a href="http://www.olpcnews.com/software/operating_system/ivan_krstic_xo_crippled_by_cra.html">crack-smoking hobos</a> written all over them. Huawei &#8220;Mobile Connect&#8221; is ugly, crash-prone, writes logs to the console like there&#8217;s no tomorrow (literally <a href="http://forum.huawei.com/jive4/thread.jspa?threadID=327290&amp;tstart=200&amp;orderStr=8">thousands of messages per minute</a>), and has never yet successfully connected me.</p>

<p>Luckily, you don&#8217;t need to use Mobile Connect: once the drivers are installed, you can connect using the menu item for the modem. Or rather, once the drivers are installed and you&#8217;ve taken the following counter-intuitive and undocumented step you can.</p>

<h3>Making it work</h3>

<p>When it installed, my dongle was configured as Vendor: Other, Model: Huawei Mobile Connect &#8211; 3G modem (this is under System Preferences &gt; Network &gt; <span class="caps">HUAWEI </span>mobile &gt; Advanced&#8230;). This sounds good, but it doesn&#8217;t work: there&#8217;s nowhere to enter your <span class="caps">APN.</span></p>

<p><img src="http://blog.mackerron.com/wp-content/uploads/2009/08/Picture-7.png" alt="System Preferences screenshot (before" /></p>

<p>Instead, after much fiddling, I found I had to switch Vendor to Generic and Model to <span class="caps">GPRS </span>(GSM/3G). Although confusingly less right, this does seem to do the trick.</p>

<p><img src="http://blog.mackerron.com/wp-content/uploads/2009/08/Picture-9.png" alt="System Preferences screenshot (after" /></p>

<p>I also ended up downloading <a href="http://www.huawei.com/mobileweb/en/doc/list.do?type=-1&amp;id=736">new drivers from the Huawei site</a>. (Not for the <span class="caps">E160.</span> That would be too simple. The &#8216;Mac&#8217; drivers for the <span class="caps">E160 </span>turn out to be a Windows .exe file. The drivers I&#8217;m using are supposedly for the <span class="caps">E220</span>). I&#8217;m not sure if this step was necessary or even well-advised, but it might be worth trying if you&#8217;re not having any luck.</p>

<h3>Listen up, O2</h3>

<p>Which brings us to the suggestion to <span class="caps">O2.</span> O2: I have an iPhone. It&#8217;s on your network. It supports tethering. I&#8217;m not about to <a href="http://shop.o2.co.uk/update/internet.html">pay you an extra &#163;15 a month</a> for the once or twice a month I want to use it. Let me use it for pay-as-you-go mobile broadband!</p>

<p>In this case you&#8217;d have saved yourself the full cost of a modem dongle &#8212; and generally, you&#8217;d be saving yourself the support costs and return costs associated with everyone who can&#8217;t get the horrible thing working. You&#8217;d have saved the world the cost of the resources and pollution required in manufacturing it. And you&#8217;d have saved me the pain of several hours fiddling with System Preferences, the inconvenience of another gadget to pack for every trip, and probable future kernel panics associated with Huawei&#8217;s flaky drivers.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.mackerron.com/2009/08/01/o2-mobile-broadband-on-a-mac-tips-for-you-suggestion-for-o2/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  blog.mackerron.com/category/iphone/feed/ ) in 0.32473 seconds, on Feb 5th, 2012 at 2:56 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 5th, 2012 at 3:56 am UTC -->
