<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Fredrik Andersson on Medium]]></title>
        <description><![CDATA[Stories by Fredrik Andersson on Medium]]></description>
        <link>https://medium.com/@freddetastic?source=rss-2317d01278c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*d3a-V87_tgP7LpKw.jpeg</url>
            <title>Stories by Fredrik Andersson on Medium</title>
            <link>https://medium.com/@freddetastic?source=rss-2317d01278c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 07:27:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@freddetastic/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Creating a check-in iBeacon experience]]></title>
            <link>https://medium.com/@freddetastic/creating-a-check-in-ibeacon-experience-5ac82f489c35?source=rss-2317d01278c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ac82f489c35</guid>
            <dc:creator><![CDATA[Fredrik Andersson]]></dc:creator>
            <pubDate>Mon, 21 Apr 2014 21:24:56 GMT</pubDate>
            <atom:updated>2015-07-22T09:07:54.649Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using your Mac, your iPhone, Facebook and Parse.</h4><p>Before I start this guide I would just like to point out that I’m <strong>not</strong> an experienced iOS developer, therefore some of the code could probably be optimized, modified or removed. I appreciate all kind of feedback, the more feedback the better.</p><p>In this guide you will learn how to setup your Macbook Pro as an iBeacon, use your iPhone (BLE compatible) as an iBeacon receiver, fetch data from Facebook and show relative data in a web browser.</p><p>You will need:</p><ul><li>1x Macbook (I use the Retina early 2013)</li><li>1x iPhone or iPad (I use iPhone 5)</li><li>Xcode</li><li><strong>Facebook application on your phone (</strong><em>you can of course do it without the Facebook app, but just for testing purposes this works a lot smoother.</em><strong>)</strong></li><li>Apple Developer account to run it on device</li></ul><p>So let’s get started, I hope you are ready since it’s gonna go blazingly fast!</p><h3>iBeacon</h3><ol><li>Download BeaconOSX from <a href="https://github.com/mttrb/BeaconOSX">here</a>. (Thanks Matthew Robinson)</li><li>Run the downloaded Xcode project and remember the UUID (the long number) presented in the interface. (Thanks Falko Richter)</li></ol><p>You’re done with setting up the iBeacon, that was hard, eh?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*nHlXgKNkj8djU2SKJaFnpQ.gif" /></figure><h3>iBeacon receiver</h3><p>I’m using the iPhone 5 as my receiver, any compatible Apple phone should work just fine.</p><ol><li>Register and create an app (<em>Dashboard &gt; Create new app</em>) at <a href="https://www.parse.com/">Parse</a>. Parse is our <a href="http://en.wikipedia.org/wiki/Front_and_back_ends">back end</a> for this guide. That’s all for now.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*glTtNeJ7WyoJY-XEcsUnQg.gif" /></figure><p>2. Create an app at <a href="https://developers.facebook.com/">Facebook Developers</a>. Store your Facebook ID somewhere since we are going to use it later, also remember to add your Bundle ID to your Facebook app, in my case it’s something like this “com.test.beaconTest”.</p><p>3. Download my <a href="https://www.dropbox.com/s/tvh8uyvnlvomp5y/beaconTest.zip">Xcode project.</a> (gitHub coming soon).</p><p>4.<strong> Before you run it</strong>, we need to do a few modifications.</p><p>In AppDelegate.m on <strong>line 18</strong>, start by adding your Application ID and Client key. You can find both of them on your dashboard in Parse.</p><blockquote>// ****************************************************************************</blockquote><blockquote>// Uncomment and fill in with your Parse credentials:</blockquote><blockquote>[Parse setApplicationId:@”<strong>YOUR ID</strong>” clientKey:@”<strong>YOUR KEY</strong>”];</blockquote><p>Now you have your Parse setup and now it’s time to setup the Facebook part. In your &lt;BundleID&gt;-Info.plist we need to add a few values.</p><p>Your three last values in your .plist should be FacebookAppID, URL types and FacebookDisplayName. FacebookAppID is gonna be your Facebook App ID (duh), URL types is an array and if you go into it you will see that Item0 needs to be “fb + your Facebook App ID”. FacebookDisplayName is your Facebook Display Name.</p><p>Facebook part is done!</p><p>The last part we need to do in our Beacon Receiver is to change the UUID to the one we have on our Mac iBeacon application. On <strong>line 29</strong> in ViewController.m you can change your UUID value.</p><blockquote>NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@”<strong>USE YOUR UUID</strong>&quot;];</blockquote><p>If you have done everything correct it should be working right now!</p><p>If it doesn’t work, make sure you have Background Refresh enabled on your iPhone as well as allowing your app to use Location Services, and of course have Bluetooth enabled.</p><p>If you’re getting Apple Mach-o linking error, these are the frameworks you need to have: CoreBluetooth, CoreLocation, Foundation, CFNetwork, CoreGraphics, MobileCoreServices, Security, SystemConfiguration, UIKit, <a href="https://parse.com/docs/downloads/">Parse</a>, <a href="https://developers.facebook.com/docs/ios/">Facebook SDK</a>.</p><h3>Web</h3><p>Since we are pushing data to Parse we can use this Javascript (jQuery) code to fetch it to our own website, add some Ajax and you got a nice realtime check-in experience. There are a lot of ways to create your own <a href="https://parse.com/docs/js_guide#queries">query</a>.</p><blockquote>Parse.initialize(“<strong>YOUR APPLICATION ID</strong>&quot;, “<strong>YOUR JAVASCRIPT KEY</strong>”);</blockquote><blockquote>var fetch = Parse.Object.extend(“online”);</blockquote><blockquote>var query = new Parse.Query(fetch);</blockquote><blockquote>query.equalTo(“online”, 1);</blockquote><blockquote>query.find({</blockquote><blockquote>success: function(results) {</blockquote><blockquote>var online = results.length;</blockquote><blockquote>$(“#online”).text(online);</blockquote><blockquote>// Do something with the returned Parse.Object values</blockquote><blockquote>for (var i = 0; i &lt; results.length; i++) {</blockquote><blockquote>var object = results[i];</blockquote><blockquote>$(“body”).append(‘&lt;img src=”‘ + object.get(‘image’) + ‘” alt=”” /&gt;’);</blockquote><blockquote>}</blockquote><blockquote>},</blockquote><blockquote>});</blockquote><p>I’ve only fetched the Facebook profile image in my Xcode project, but you could for example fetch the persons favorite music band or relationship status and also push that to your website, would be cool to have at an event for example, the possibilites are endless!</p><p>As you see in the ViewController.m on <strong>line 208</strong>, I have also added the CoreBluetooth’s proximity functions (unknown, far, near, immediate). The reason I added them was only for testing purposes, maybe you can do something fun with them using multiple beacons or something else, who knows!</p><p>If I have missed something or you are getting stuck somewhere, please send me a tweet and I’ll help you out!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ac82f489c35" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>