<?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>chris moos&#039;s blog &#187; mobile</title>
	<atom:link href="http://chrismoos.com/tag/mobile/feed/" rel="self" type="application/rss+xml" />
	<link>http://chrismoos.com</link>
	<description>developer by day, developer by night</description>
	<lastBuildDate>Fri, 30 Jul 2010 04:52:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Colloquy for iPhone &#8212; Push Notification&#160;Server</title>
		<link>http://chrismoos.com/2009/10/22/colloquy-for-iphone-push-notification-server/</link>
		<comments>http://chrismoos.com/2009/10/22/colloquy-for-iphone-push-notification-server/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 00:04:42 +0000</pubDate>
		<dc:creator>Chris Moos</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[colloquy]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[push]]></category>

		<guid isPermaLink="false">http://chrismoos.com/?p=590</guid>
		<description><![CDATA[Colloquy is a great IRC client for Mac, as well as the iPhone. Currently, to run Colloquy on the iPhone you must purchase the mobile version from the App Store. The other option is to download the source and build it yourself, but you must be a registered iPhone developer to run it on an [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://colloquy.info/">Colloquy</a> is a great IRC client for Mac, as well as the iPhone. Currently, to run Colloquy on the iPhone you must purchase the mobile version from the App Store. The other option is to download the source and <a href="http://colloquy.info/project/wiki/MobileFAQs#CanIgetthesourcetobuildMobileColloquymyself">build it yourself</a>, but you must be a registered iPhone developer to run it on an actual iPhone. Also, if you intend to use push notifications (via the Colloquy ZNC plugin), you must have a push certificate as well. </p>
<h2>Getting Started</h2>
<p>I am going to assume that you have znc installed, and you know how to use it. Next, we need to install the Colloquy ZNC module, so that Colloquy can communicate with ZNC (and allow us to have push functionality). See <a href="http://colloquy.info/project/wiki/PushNotifications#ZNCforMacOSXandLinux">this page</a> for complete instructions.</p>
<p>The module for ZNC accepts commands from the Colloquy client, notably information on push notifications(device token, etc,.).</p>
<h2>Modifying the Colloquy Mobile Source</h2>
<p>Next, we need to download and <a href="http://colloquy.info/project/wiki/MobileFAQs#CanIgetthesourcetobuildMobileColloquymyself">build the source</a>. Once you have downloaded the source and loaded up the Mobile Colloquy project in Xcode, we need to make a few modifications.</p>
<h4>Certificates</h4>
<p>To run any application on an actual iPhone device, it must be signed. Login to your Developer portal on Apple&#8217;s site and generate a certificate (and make sure to enable push). Download the certificate and install it. Next, assign that certificate to the Colloquy Mobile Project. <em>Project&#8230;Edit Active Target</em>. Make sure that under the <em>Properties</em> tab, you have the same Identifier name that you used when generating the certificate. Go to Build, and then <em>Code Signing Identity</em> and select the certificate.</p>
<h4>Modifying the source</h4>
<p>Next, find the <em>CQConnectionsController.m</em> file (Controllers/Connections) and change the following line from:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span>self sendRawMessage<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;PUSH service colloquy.mobi 7906&quot;</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>and change it to:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span>self sendRawMessage<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;PUSH service 127.0.0.1 7906&quot;</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>This will make the client tell the Colloquy ZNC module to send push notifications to our custom server.</p>
<p>Build the project and put it onto your device.</p>
<h2>Push Server</h2>
<p>I wrote a simple python script that waits on port 7906, receives a connection from the Colloquy ZNC module, and then pushes a notification to your phone (via Apple&#8217;s Push Service).</p>
<p>The script requires your push certificate and private key file so it can authenticate to Apple&#8217;s push service.</p>
<p>Export the push certificate and private key as a .p12 from Keychain Access. After that, we have to convert it to PEM format:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl pkcs12 <span style="color: #660033;">-in</span> key.p12 <span style="color: #660033;">-out</span> certs.pem <span style="color: #660033;">-nodes</span></pre></div></div>

<p>where key.p12 is the file exported from Keychain access.</p>
<p>After that, you may need to put that certs.pem file on your server that you are running ZNC on.</p>
<h4>Installing the Colloquy Push Server</h4>
<p>Run the following to install the Colloquy Push Server:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> easy_install http:<span style="color: #000000; font-weight: bold;">//</span>www.tech9computers.com<span style="color: #000000; font-weight: bold;">/</span>ColloquyPushServer-0.1.tar.gz</pre></div></div>

<p>Next, run the command <em>colloquypushsrv.py</em> to make sure installation was successful. </p>
<p>The usage looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usage: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>colloquypushsrv.py <span style="color: #7a0874; font-weight: bold;">&#91;</span>-p listen_port<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>--sandbox<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>-b<span style="color: #7a0874; font-weight: bold;">&#93;</span> certs_file
	Command Summary:
		certs_file	        PEM encoded Apple Push certificate and private key <span style="color: #c20cb9; font-weight: bold;">file</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>absolute path<span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #660033;">-p</span> listen_port	Default Listen Port: <span style="color: #000000;">7906</span>	
		<span style="color: #660033;">--sandbox</span> 	Connect to Sandbox Service
		<span style="color: #660033;">-b</span>		        Run <span style="color: #000000; font-weight: bold;">in</span> background</pre></div></div>

<p>Now, let&#8217;s start the push server in the foreground. Make sure to specify the full path to the pem file we created.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">colloquypushsrv.py ~<span style="color: #000000; font-weight: bold;">/</span>certs.pem</pre></div></div>

<h2>Conclusion</h2>
<p>Finally, connect to your ZNC server with the custom built Colloquy Mobile. Your iPhone should register with the ZNC module. After, exit the Colloquy Mobile application and pull up Colloquy (or any other IRC client) on your desktop. Send yourself a message, and see if you get the push notification!</p>
<p>I realize this process may not be completely clear, so if you have any questions, I would be happy to walk you through the process.</p>
<p>Also, I just wrote this up today, so it may not be production ready <img src='http://chrismoos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://chrismoos.com/2009/10/22/colloquy-for-iphone-push-notification-server/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MoosTrax Mobile&#160;Site</title>
		<link>http://chrismoos.com/2009/03/06/moostrax-mobile-site/</link>
		<comments>http://chrismoos.com/2009/03/06/moostrax-mobile-site/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 09:21:54 +0000</pubDate>
		<dc:creator>Chris Moos</dc:creator>
				<category><![CDATA[moostrax]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://chrismoos.com/?p=266</guid>
		<description><![CDATA[You can now access a smaller, stripped down version of the MoosTrax site on your mobile phone by visiting http://m.moostrax.com. Currently only live tracking is supported. 
]]></description>
			<content:encoded><![CDATA[<p>You can now access a smaller, stripped down version of the MoosTrax site on your mobile phone by visiting <a href="http://m.moostrax.com">http://m.moostrax.com</a>. Currently only live tracking is supported. </p>
]]></content:encoded>
			<wfw:commentRss>http://chrismoos.com/2009/03/06/moostrax-mobile-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
