Browsing Google Chrome and the Physical Web

Google Chrome Physical Web URL

Chrome 57 has launched, and with it in-browser support for the Physical Web. Now, when a user goes to conduct a search or enter a web URL, any nearby Physical Web addresses will appear just below the address bar as seen in the above graphic.

It adds another piece to the proximity puzzle – allowing your browser to show nearby URLs when you go to enter a Web URL or go to conduct a search.

Use Cases for Chrome URLs

Being able to see nearby Physical Web URLs in your browser suggests some interesting use cases/value propositions:

Closing the Gap on Physical Web Objects – in the world of the Physical Web you walk up to a “thing” and use it. In general, their use case is for that “thing” to include a Physical Web icon. You need to know that the object has a URL attached to it. This is usually accomplished through physical-world icons/signage. You then need to know to “pull down” on a notification tray to see it.

By adding Physical Web URLs to your browser search/address bar, there’s another path to making sure users will more easily be able to “see” that URL.

Show-rooming – Retailers still struggle with ‘show-rooming’ – where users will be shopping, say, for a fridge and go online to compare prices when in the store. By attaching a physical web beacon to the fridge, the retailer has a last chance to catch the user’s attention with a link of their own.

In the Home – This is, perhaps, where beacons can truly start to merge over with the connected home. Device makers (say, the Nest thermostat) can embed a Physical Web broadcast. Now, your thermostat, connected TV or other device can offer up a manual, support hotline or other information as an available link in your browser – and possibly bypass the need for a custom app.

Bluetooth in the Browser

Things start to get really interesting when you take into account the fact that Chrome also supports Bluetooth connections.  By allowing Chrome to connect to nearby Bluetooth devices, you can create use cases where a Physical Web signal leads to a web URL. The web URL leads to a page with support for Bluetooth connectivity.

(We should note that Bluetooth proximity and Bluetooth connectivity are two entirely different things!)

Google does a deep dive on this capability and provides libraries for Angular, Node and Polymer.

We can envision use cases where you approach a fitness machine in a local gym, it has a Physical Web logo, a Physical Web URL shows up when you search in Chrome, and the web page it takes you to can connect to the machine and read out heart rate or other information.

Go Chrome, or Go Physical Web?

This addition to the “proximity pathway” is great. But it adds another layer to an already confusing set of instructions for consumers.

One interesting question: when you’re creating an in-location sign/symbol or marker to let consumers know there is a nearby URL, should you flag it as Physical Web, or Chrome?

I’ve been wondering whether the Chrome logo wouldn’t be a better way to go. It bridges Android and iOS, is a recognized symbol, and is WAY easier to explain.

Because when the current instructions look like THIS, wouldn’t THIS be easier to understand?

Share Your Thoughts

Join our e-mail list for more on iBeacons, Eddystone, Physical Web and BLE. Join the conversation on Twitter, or connect with me on LinkedIn.

Have you engaged yet with a Physical Web URL via Chrome? What use cases do you think we’ll see? And do you think the Physical Web icon will be a driver of adoption, or will we see other ways to promote these new features?

Drop a comment below, or pop me a note on Twitter.

Content Creator or “Business Builder”? Drop Me a Line

On a side note, we’ve been partnering with content creators, publishers and entrepreneurs of all stripes. We’ve been building out tools to bring proximity channels to new markets. If you’d be interested in learning more, don’t hesitate to drop me a note – doug (at) fidgets.net . Our mission is to help content creators,  publishers, entrepreneurs and companies to build new revenue streams on the Internet of Things.

Google, Beacons and the Black Box

When Google launched its response to the Apple iBeacon standard, it established itself as best-in-class for the field. But as it worked to integrate different initiatives within the company, it has left some notable gaps that hinder the development of effective user experiences.

It can be hard enough to understand all of the competing terms and standards. Sorting out whether your beacon should broadcast Eddystone, Physical Web or iBeacon signals is confusing enough.

But ending the process with a “black box” around your analytics makes it difficult to achieve what Google intends: useful end user experiences.

Background to Beacons

Before Google, all the hype was built around Apple’s iBeacon. The media (and developer community) often conflated software and hardware protocols. There was a perception that Apple was delivering ads based on proximity. Overall, there was both confusion over what iBeacon is or isn’t, and where Apple intended to take it.

Bluetooth Beacons First, it’s good to remember that beacons are all built on the same standard: Bluetooth LE. This is a protocol by Bluetooth for a low energy signal. The proximity standard is one of those protocols. This standard can be ‘interpreted’ in a number of different ways. Basically, Bluetooth provides a method for sending a radio signal in which a packet of data is included. How you use that packet is up to you.

iBeacon When Apple first launched its own standard for how the ‘packet’ should be encoded, it created confusion. iBeacon encompassed the standard for broadcasting, but it also came to include (at least in the popular imagination) the software tools for iOS developers, and the beacon itself (by being allowed manufacturers to use the iBeacon symbol).

Since its launch of iBeacon, Apple has done – well, nothing. Ahead of last year’s developer conference, they announced plans to integrate iBeacon with its iAd platform, giving brands the opportunity to deliver content to beacons without the need for an app.

But Apple pulled the plug on its iAd platform, and iBeacon (and the Apple approach to Bluetooth proximity) remained unchanged for yet another year.

Decoding Beacons the Google Way

Along came Google. When it launched its Eddystone standard, the press hailed it as an iBeacon competitor. And narrowly defined, it was. But this masked a much wider ecosystem. Google support for beacons was both more robust and more confusing.

It’s helpful to begin with understanding a few of the terms that apply in the Google ‘universe’ of beacons:

Physical Web This was the first unofficial entry from “Google” into the world of beacons. And I use the term in quotes because Physical Web is an open source standard which at first seemed loosely coupled with the company. Spearheaded by Scott Jenson, it is a standard protocol for broadcasting a URL in a beacon broadcast.

Browsers and operating systems which support “listening” for this URL can then display a web page.

Since its launch, Physical Web has expanded to include a number of methods (such as Wi-Fi Direct and SSDP) that can act as alternatives to physical beacons for broadcasting a URL.

Eddystone This was, perhaps, the true “Google response” to Apple iBeacon – “a protocol specification that defines a Bluetooth low energy (BLE) message format for proximity beacon messages.” The protocol is for an open format beacon.

It picked up where iBeacon stopped and addressed some of the key concerns with the Apple standard. By offering three different broadcast protocols, it allowed:

  • Secure broadcasts through Eddystone-EID (a companion framework) so that only authorized devices can ‘see’ your beacon
  • Additional flexibility within the broadcast packet, giving manufacturers some ‘room to maneuver’ compared to the Apple standard
  • Better support for beacon monitoring and management through Eddystone-TLM

Google Nearby Finally, Eddystone was launched with support for Google Nearby. This allows you to register your beacons with Google and present a notice to user’s phones, even if they don’t have an app.

And it’s on this last item that things get interesting. Because without the need for an app, you can now engage with users in a new way – by directing them to an app download page, or to an https web page of your choosing.

Google is Not One Thing

So Google launched Eddystone. It launches beacon support through Google Nearby. And it launches a collision of standards.

Let’s say you want to support iBeacon and “Google”. So you put out beacons that broadcast the Physical Web, iBeacon, and maybe AltBeacon because you have an app that uses it.

You register iBeacon with Google Nearby (huh? Yeah. You can even register an iBeacon to Google Nearby).

Now, your end user might be getting multiple notices – one via Google Nearby, one through your app, and one for Physical Web.

This confusion stems, in part, because different units within Google are developing in parallel – whether the Nearby team or Chrome.

Over time, Google started to coordinate all of these efforts, and has done a brilliant job iterating and improving the user experience. Now, your phone will sort out the Physical Web and Nearby signals and start to sift through them to avoid confusion.

Meanwhile, as a developer, brand or retailer, you’ll still need to sort out the differences between the 100s of Android phones – but that’s the pain of entry into the Android world. (With Samsung recently announcing its CloseBy standard, at least we’re seeing a relative match-up to the Nearby approach).

The Silent Notification

OK, so you’re still probably a bit confused. You’re not alone.

So let’s simplify things a bit:

  • You can now send a beacon notice even if your end user doesn’t have an app
  • This notice can link (via Physical Web, Google Nearby or…soon, Samsung CloseBy) to a web page or app download
  • This notice is silent. Which means the user needs to know to take an action (swiping down, for example, for the notification tray) to see your notice.

Users with Bluetooth on and widgets activated will always be able to see a silent notice. The Physical Web will always show in the notice tray if, for example, you’ve activated the Chrome widget on your iPhone.

But the notification is “silent”.

Except when it’s not.

Because with Google Nearby there’s a catch:

Android users near that device or beacon will see the message in the Nearby section of Google Settings, the Nearby Quick Settings tile will light up on supported devices, and messages that perform well will be raised as notifications.

And there’s the rub: “messages that perform well“.

Because – well, there’s no way to know.

The Data Gap

There’s a problem: Google doesn’t want to spam end users with unwanted messages. According to Google, their data clearly shows that inappropriate messages will ‘turn off’ end users. We can imply that this could lead to turning Bluetooth off, or otherwise disabling Physical Web or Google Nearby.

We get it. So, as a developer, you want to do your best – to test, say, multiple messages. To look at the data and tweak your messages so that it gets better. To improve your performance so that Google will ‘un-toggle’ your notices and present more of them to your end users.

But you’re fighting a battle with one hand tied behind your back:

  • You don’t know how many total devices were eligible for your message
  • You don’t know how many users “pulled down” and therefore don’t know what your hit rate is with a specific message
  • You might not have a good handle on how much physical foot traffic you get near your beacon

All you know is that 50 people (say) opened your page. You don’t know how many of those were from a “pull down”, how many were from a “raised notification”, or how many people even saw your message in the first place.

And to make matters even more difficult, there’s no way to test any of this in your development environment. You can’t easily “reset” your test phone so that it acts like a naive user. Google interprets development and production the same way via Nearby.

We’re working in the dark.

And there’s no easy answer.

Is There a Solution?

With Google I/O approaching in May, I half suspect that Google will monetize Nearby – letting you pay to raise your notification in a more consistent way. Maybe they’ll connect up to Google Analytics or Firebase Analytics.

But even if they don’t there’s no easy way for Google to solve this black box issue without raising a host of other issues.

For example, if you were to give a total count of ‘eligible devices’ wouldn’t this open up the chance to snoop on foot traffic and device counts? Couldn’t you then place a beacon inside a competitor store and use this data to snoop on their location foot traffic data?

But to start, developers and Nearby users should at least be provided with some simple tools to help them improve the end user experience. Some baseline data would be a start:

  • When you launch a Nearby campaign with beacons, what is the starting percentage of users who will see your “raised” notification?
  • What is the maximum value this will go up to?
  • Can Nearby provide the capability of A/B testing messages and report back on which message included a “boost” to raised notifications?
  • Can we get access to “percentage of raised notifications” even if it doesn’t give us numbers?

Providing a better method for toggling Nearby beacons to “development” along with better instructions on how to treat a development phone as a naive user would also be a big improvement.

Google is doing it right – they’re making sure that users aren’t spammed, that we don’t see a backlash to beacons, and that the different notices are ‘streamed’ effectively from the different protocols.

But to get to the next step, Google should provide developers with some sort of feedback to help them improve the effectiveness of messages. This type of two-way partnership will be key to the continued uptake of beacons.

Share Your Thoughts

Join our e-mail list for more on iBeacons, Eddystone, Physical Web and BLE. Join the conversation on Twitter, or connect with me on LinkedIn.

How do you assess the effectiveness of Nearby or Physical Web projects? How do you assess the data? What would you like to see Google provide (data or other tools) to help improve the end user experience? Drop a comment below, or pop me a note on Twitter.

 

 

 

 

WWDC 2016: iBeacon and Apple’s Last Chance

Google is cleaning Apple’s clock in proximity. Their suite of software development tools leaves Apple in the dust – from tight integration of their Nearby API and their Eddystone beacon protocols, to the monumentally important physical web, Google is making sense of proximity.

It didn’t need to be that way. Apple was first out of the gate with the iBeacon protocol. They had ample opportunity to take it further.

But a few World Wide Developer Conferences later, and iBeacon is the orphan child of Cupertino – filled with vague promises never fulfilled.

The only hint of iBeacon heading in a new direction was the announcement that you would soon be able to deliver “Offers” . But the project was abandoned when Apple killed iAd. (And the link to the Apple announcement has long been dead).

The Mistakes Apple Makes

The launch of iBeacon promised to revolutionize how our phones would react to the world around them. Apple launched it with little fanfare and yet it prompted a wave of hype – the promise that retailers could reach consumers with coupons, that museums could display digital data “next to” a painting or sculpture, or that we could track down friends at a club because their phones would be broadcasting as beacons.

The initial problems were understandable. A new way to “listen” to nearby devices was bound to have a few bumps. And you’d expect over time that Apple would continue to enhance and improve the technology.

But after several years, the changes have been minimal. And in some ways they’ve perhaps even degraded.

The technology itself, however, wasn’t the only problem:

  • iBeacon was a trademark for beacons, but Apple offered little value in the iBeacon brand. You could adopt the iBeacon mark – or not. There was little incentive for beacon manufacturers to proudly wave the iBeacon flag, because it offered little assurance to end purchasers. Sure, it said that “this beacon can be heard by iPhones” but this caused more of a limitation than an opportunity – because the obvious next question was “What about Android?”
  • Apple lawyers got in the way. The company aggressively protected its ‘iBeacon specification’. But the move was kind of like trying to protect a proprietary version of WiFi – it’s a technology everyone needs to use, and by ‘blocking’ access it created market confusion and all kinds of end-runs around the iBeacon standard.
  • iBeacon detection became (even more) unpredictable. With every new OS release, you’d have to test all over again. The dependability of beacon detection kept changing. With one release, you would detect beacons quickly, and with the next O/S it seemed as if Apple was trying to conserve battery and had toggled back beacon monitoring. Without the ability to dependably say how long it would take to detect a beacon, and without being able to see ‘under the hood’ developers were faced with constantly checking their assumptions about beacon detection every time a new version of iOS was launched.
  • There was little integration with other parts of the Apple ecosystem. Have you ever tried to register your “place” with Apple? I can barely find the page. Google, on the other hand, offers much deeper integration with other parts of their ecosystem – in part because of how far ahead they are on things like maps, places, nearby and other protocols.

But perhaps more than the above, Apple neglected the one thing that it does best: focusing on the end user.

Instead, it has allowed app developers to make what they will of iBeacon and BLE, while offering little guidance on how to create great consumer experiences. As a result, we’ve seen struggles in develop “hits” – apps where consumers truly get a ‘wow’ factor.

This isn’t solely Apple’s fault, of course. Instead, the company has focused on other broader experiences – and will perhaps one day bring iBeacon back into the fold.

Physical Web is a Game Changer

Google, on the other hand, looked at the experience of proximity and has created beacon-detection tools that make sense – the Eddystone protocols are well considered, have rich documentation, great examples, and tight integration with other services.

But the true game changer is the Physical Web. And while it’s early days, the Physical Web creates opportunities for user experiences that truly make a difference – by hooking proximity into the web itself.

With the shift to browsers that can detect and control all kinds of BLE devices, the Physical Web is one part of a larger shift to a Web which reacts to the physical world – and in this open world Google will always be master.

The tension between open and closed systems will continue to tug and pull, but for right now open is winning and Apple is left behind.

WWDC – What’s Next?

All of which leaves Apple with one last chance – to elevate iBeacon from orphan child to star of the show.

If Apple makes a move, it won’t be to enhance the ability to deliver coupons. It will be part of a larger ‘connected space’ strategy which may incorporate Apple News, Music or other products.

But it’s a last kick at the can for Apple, in my opinion. Because depending what approach they take at their Developer Conference in a few weeks, developers may well migrate to a “Google-only” proximity strategy (including the use of Google tools on Apple devices).

It’s up to Apple, as they have many times before, to take what others have done and make it their own. But in this case, the mistakes they need to learn first are their own.

Share Your Thoughts

Join our e-mail list for more on iBeacons, Eddystone, Physical Web and BLE. Join the conversation on Twitter, or connect with me on LinkedIn.

Do you think Apple can change the game? Or will Google now dominate proximity? What could Apple do next with iBeacon – or is it too late? Drop a comment below, or pop me a note on Twitter.

Kontakt to its Customers: You’re All Doomed


Kontakt, one of the largest manufacturers of beacons, has a message for its customers: you’re all doomed.

In what might rank as one of the more bizarre examples of corporate messaging, the company’s founder has taken to LinkedIn to pronounce that with the arrival of the Eddystone beacon protocol (and related services) by Google, proximity companies are headed for the dust bin if they don’t radically change (and soon).

“Ask not for whom the bell tolls, proximity devs: it tolls for thee,” proclaims Szymon Niemczura.

But extending the logic of Szymon’s article, you can’t help draw the conclusion that it isn’t just the devs who will pay the price for Google’s entry into the market.

If you’re a retailer, a brand, a museum, a car company, a city or a theme park – you too should just throw up your hands and give up now.

Google will own mobile moments, the borg has arrived, and closed off becosystems will look something like AOL in the years to come: a walled garden that no one visits anymore.

And Apple? Naw. Says Szymon:

With a vanishing share of the smartphone market, the last thing the house that Steve built wants to do is give developers even more reason to jump ship.

Ah yeah. Poor Apple. Poor shrinking tiny little Apple. It’s hard to remember that they’re still around! It will be cute to see what little features they try to throw at us to protect their ever-vanishing market share and profits.

What’s Your Secret Sauce?

Now, I like Kontakt. They’re some really really smart people.

(Although, what’s with the videos that look like they were shot at summer camp? And by the way – audio engineering is a thing).

So maybe they have a secret sauce as Szymon claims: “At Kontakt.io, we think we’ve found our special sauce that will keep us growing and thriving as giants of the Internet space like Google, Apple, Facebook, and others compete over who earns what from the IoT.”

In response to which I have a question: China?

Because if Szymon’s observations are true, then the beacon itself has become king. The app layer, the SDKs and the software, the cloud services and back-end analytics will be swallowed up by the Web.

The promise of Eddystone is that you can turn your beacon into a Web endpoint and simply broadcast a URL.

And if that’s true, then it opens up the opportunity to flood the market with cheap beacons from China that do nothing more than broadcast a URL.

Do You Jump Into Bed With Google?

Setting aside the tone of Szymon’s article, it points to a larger question.

Because what’s clear is that Google has hit a home run. Eddystone is everything a beacon should be.

Google took a page from the Apple playbook: wait for the industry to develop, cherry pick the best ideas, and then come out with something that does everyone else one better.

The Eddystone format is brilliant.

But now you need to make a decision: do you go “all in” with Google, do you try to find a middle ground, do you focus on the “app-less” layer or combine different proximity experiences to create a unified customer journey?

Creative Tensions Between Open and Closed Systems

The way you answer the above questions will have a big impact on what kind of beacon you buy and what kind of customer experience you want to create.

In an interview with Kontakt, they clearly think that the “app-less beacon world” is a big deal:

Along with yesterday’s release of new Chrome browser for iOS with support for a Physical Web standard this became clear – proximity devices are able to communicate with our phones without the need for other apps. This means a Physical Web is finally visible and ready for broader adoption.

But here’s the problem: what does “communicate with our phones” mean?

Is that all we really want to do? Is your vision of the mobile world one in which the Web has won?

Szymon is right:

“10 years in Internet is effectively forever, and it’s a rare startup that considers what the landscape will look like as far out as two years, but this matters, so I’ll point it out: native capacity to push alerts and more direct from beacons to devices kills a huge number of app use cases.”

Truly, the traditional definition of an “app” is eroding.

There will be apps that sit on your phone but that you’ll never use on their own. Instead, they’ll be shared as ‘sheets’ inside other apps, provide deep linking capabilities, and sit as a kind of invisible thread across an ecosystem of experiences.

But that doesn’t mean that apps will be replaced by whatever Google has to offer, anymore than it means that HTML will win in the war against native.

Which is why Eddystone does more than just broadcast Web pages (although its ability to do so will open up some pretty great user journeys).

Like many engineers, Kontakt seems to be more interested in the transactional nature of systems than the very real human experience they entail.

(Just look at Kontakt’s Web site or its developer portal and you’ll see what I mean – they feel like were designed in 2002 by a bunch of engineers one weekend).

The implication here is that in the tension which will always exist between open and closed systems, the pendulum has swung: open will win, Google is right, native is disappearing and apps are dead.

If you’re willing to make that bet, great. Go for it. At least you’ve taken a stance! And perhaps in the longer arc of history you’ll be right – but until then we still have to worry about today.

What Kind of Beacon Will You Use?

In response to questions about Eddystone, Kontakt tells me that you’re going to need to make a choice (at least for now) in which of their beacons you choose: Eddystone OR iBeacon.

Why? Because battery.

In an interview, Kontakt tells me:

Our beacons broadcast 4 different frames one after the other: 3 advertising packets (Eddystone-UID, Eddystone-URL, Eddystone-TLM) and a scan response. To the best of our knowledge, Kontakt.io is the only company on the market who has offered that from day one.

We have been investigating the possibility to add also an iBeacon frame to the set, but broadcasting that many different packets is going to cause a pretty heavy battery drain. While we research ways to help keep a useful battery life on our product, we will also be looking at client demand for this feature. We don’t have any timeline on when we may roll this out, as it’s very much just in R&D right now.

Which is odd, considering that if you don’t interleave with iBeacon, then your beacon battery might be fine, but the iOS user’s won’t be. By relying on Core Bluetooth instead of the native framework from Apple, you can expect Apple users to take a hit on battery life if you’re solely relying on the Eddystone format.

These kinks might be worked out, but it’s an obfuscation to say that it’s your beacon’s battery which is the sole limitation.

In fairness, Kontakt isn’t entirely advocating a “throw out your iBeacons” stance. If you’ve got some of those old beacons lying around then sure, why not, you should hang on to them. (But I guess you should know that you’re missing out on some huge potential):

Every discussion regarding iBeacon and Eddystone formats, and which one fits our client needs better, always starts with a question about use case details. Eddystone opens new possibilities, but at the same time requires more complicated coding to integrate as it sends more types of data than iBeacon does. Beacons that use Eddystone-TLM format to send telemetry data (such as temperature data) will have shorter battery life because they are sending more data packets etc. All of that needs to be taken into account before we jump on the Eddystone bandwagon.

In general, I think that “switching” is probably not the correct choice for anyone with a live deployment right now. Anyone with a P.O.C. that’s running, though, or someone who’s in early tests? I would strongly encourage that those people try this out because this whole platform is growing in exciting ways and has huge potential.

For many use cases, an Eddystone URL format beacon might be fine. You might be able to move the needle a bit on customer engagement.

For everyone else, there are larger questions at stake.

Kontakt itself hints at this future. With the coming wave of mesh beacons, the company’s Cloud Beacon takes aim at what will happen when the next Bluetooth specification starts hitting the market. The company tells me they have big plans, and that those plans validate why its Cloud Beacon format isn’t threatened by Google’s Proximity API:

Our Kontakt.io Cloud Beacon remains the only enterprise-level tool for beacon monitoring that we’re aware of: if you need to be able to guarantee that you are scanning and looking at beacons in a given area at regular intervals, a Cloud Beacon is your best bet. On top of that, Cloud Beacons are part of our other real competitive advantages: security and sharing.

In the future we will introduce completely encrypted channels for communication between beacons, cloud beacons, and smart devices. This, combined with powerful features such as our scheduled profile shuffling (driven by our API) and the industry’s only Power Sleep mode designed to extend beacon battery life, means that the Cloud Beacon still has very strong USPs that make it an attractive prospect for any company looking to roll out beacons on the large scale.

An Industry Transformed

The industry has been transformed with the launch of Eddystone.

For beacon manufacturers, a new wave of low-cost alternatives from China will put pressure on them to tighten up the value-added services they provide, the relationships they have with developers, and the level of execution they put into their user documentation, community management and marketing.

For developers, the range of opportunities has expanded rather than contracted.

But while Eddystone might seem to cut through the clutter and remove barriers in app development it also creates a richer, and thus more complex suite of choices for brands, retailers, cities and cultural institutions.

I have deep faith in this industry.

I don’t need to give any of you a wake-up call or tell you that you’re doomed. Because for the 100s of proximity companies I’ve talked to, and for the hundreds of brands and retailers we’ve interacted with (and who are doing their best to make sense of a rapidly changing world), I’ve found that optimism in the face of progress is the best guarantee of innovation.

And this week, we’ve entered a new era in which to thrive.

Share Your Thoughts

Join our e-mail list for more on iBeacons and BLE. Join the conversation on Twitter, or connect with me on LinkedIn.

How will you respond to Eddystone? Is this a new era of doom or one of innovation?

Google Updates Terms of Service for the Physical Web

Google has updated its Terms of Service for Chrome to clarify the use of the browser as part of the “Physical Web“.

The update, which coincides with the release of beacon detection in Chrome browsers for iOS (with Android support expected in the coming days), clarifies that users won’t be sharing personally identifiable data from their device when they connect to a beacon that broadcasts a URL.

Specifically, the update, which went live on July 21st, informs users that:

If you enable the feature in your device’s Today view, you can use Chrome on your iPhone or iPad to discover objects around you that are broadcasting web addresses as part of the Physical Web. When you use this feature, Chrome sends the web addresses broadcast by these objects to a Google server to find the title of the web page and help rank the results. The information sent to Google to provide this feature does not include any personal information from your device.

Now, it’s not to say that Google isn’t using the data about which URLs are being pinged, and you need to consider your use of location services as well:

If you use Chrome’s location feature, which allows you to share your location with a web site, Chrome will send local network information to Google Location Services to get an estimated location. Learn more about Google Location Services and enabling / disabling location features within Google Chrome. The local network information may include (depending on the capabilities of your device) information about the wifi routers closest to you, cell IDs of the cell towers closest to you, the strength of your wifi or cell signal, and the IP address that is currently assigned to your device. We use the information to process the location request and to operate, support, and improve the overall quality of Chrome and Google Location Services. The collected information described above will be anonymized and aggregated before being used by Google to develop new features or products and services, or to improve the overall quality of any of Google’s other products and services.

But the update is welcome news on the privacy front.

It might not solve the problem of beacon spam if we’re suddenly flooded with millions of the little devices as we wander around the neighbourhood, but it’s somewhat assuring to know that Google isn’t sending personal information back to its servers just because your Chrome browser heard an Eddystone beacon as you walked through the mall.

Share Your Thoughts

Join our e-mail list for more on iBeacons and BLE. Join the conversation on Twitter, or connect with me on LinkedIn.

Google Eddystone Jumps into the Browser on iOS


Your browser will now connect to ‘cookies’ in the physical world – beacons, which can now broadcast a Web URL as part of Google’s new Eddystone protocol.

And Google is planting its flag on iOS devices first.

By launching beacon support within Chrome, Google is effectively bypassing the gatekeepers at Apple and providing support for beacon detection “without an app” – because the app is the browser.

Having said that, Google won’t exactly be spamming you with messages. Instead, if you’re near an Eddystone beacon, you’ll need to be using the Google Today widget in your notification center (or it will need to be refreshing).

And yet, by planting this flag in iOS, Google has a relatively confined audience to test the Physical Web – and bringing that capacity to Android (in, perhaps, a far richer format) isn’t far behind.

While the percentage of users who have installed of Chrome on iOS devices isn’t known, it’s not insignificant, and likely ranges somewhere around 10%+, representing 10s of millions of users.

The larger win will be when Google launches similar support for Android, likely in the coming days.

But beyond the installation numbers is something perhaps even more compelling – because with beacons, Google will have a way to conceivably “ping you” to open a Chrome browser that you rarely use. While not currently how they’ve designed it (they limit the notices to an active Notification Center view) it won’t be long before they take the functionality further.

Google Goes Out for Launch

It took a while, but Google launched a full beacon development framework this past week. The framework included the open source Eddystone specification for beacon broadcasting, along with a host of tools and integrations.

The project was a grand slam, perhaps shockingly so, (depending on your view of how well Google promotes itself and how well it handles documentation and design).

Apple launched its iBeacon framework with barely a whisper at its World Wide Developer Conference in 2013. It then did very little to evangelize or explain the technology and created endless market confusion (perhaps intentionally), both over what an iBeacon actually IS, how it differs from the Apple software SDKs, the difference between an iBeacon and BLE, and how it would integrate across the larger Apple ecosystem.

Since then, Apple did very little to expand the protocol. It added beacon support to Passbook, thus allowing “app-less interactions”, and it recently announced it would further extend engagement through Apple Wallet and its iAd platform.

But Google has taken a page from what you might typically think of as the Apple playbook – creating a tightly integrated system of software and services to allow rapid development and deployment of a new technology.

Additionally, it did pre-launch outreach to a few select companies, who are now beating the drums as if they’ve joined the Google empire, and it managed its press relations, publicity and self-promotion as if Marissa Mayer still worked there.

And now, its followed up the success of the Eddystone launch by planting its flag inside iOS, letting the Chrome browser detect beacons and pushing you messages even in the absence of what you normally think of as an ‘app’.

The Physical Web

What makes this possible is the unique broadcasting packet of the Eddystone beacon protocol, called the Eddystone-URL. It allows you to:

  • Broadcast a URL from your beacon instead of an ID number
  • By broadcasting a URL, you can bypass the need for an app to “parse” the meaning of a beacon’s unique ID number
  • You can thus leverage existing Web resources and simply point the user to a Web URL
  • With this capability, the potential to bypass the app layer entirely is made possible, and with Google now launching support via Chrome, you’ll be able to pop a “URL beacon” on your wall and let the Web do the rest

Back to Basics on Beacons

For those who are just joining us, a beacon is a relatively ‘dumb’ device that is based on an open Bluetooth specification. A beacon broadcasts a signal, and when your phone “hears” that signal, it can act on it.

In a traditional beacon, the signal typically consists of a unique identifier and a bunch of extra ‘keys’. When your phone (via an app) hears this identifier, it can make a decision on how to act, usually by referencing a cloud-based service which provides it instructions on what kind of content to display.

Eddystone, however, incorporates the Physical Web as one of its broadcast signals.

The Physical Web was originally one of those “in my spare time” projects at Google (most of which remain experiments and are never brought into its main business). The premise of the Physical Web was simple: rather than build a NEW infrastructure for beacon content, why not just leverage Web development?

By broadcasting a URL, your “app” wouldn’t need to go to a cloud server or otherwise parse the meaning or purpose of the ID number that the beacon broadcasts. Instead, you can just open a browser.

Eddystone lets you broadcast a URL (it also has more “traditional” beacon broadcast formats, which are still needed for richer/native type app experiences) and it’s this capacity which makes Chrome the natural choice for broader “beacon detection” without the need for an app.

The Pros and Cons for Retailers and Brands

As I wrote yesterday, Eddystone is a big win for anyone who wants to create some kind of interaction with consumers based on proximity.

It’s just a beacon, after all, and by producing a robust suite of software tools for Android, we now have an easier and better way to deploy beacon experiences to Android devices.

But beyond the beacon itself, there will be some strategic decisions to make.

Because Google didn’t just launch beacon support. It also launched a suite of accompanying APIs and integrations – and whether you decide to use them will have as much to do with your views on who owns and should monetize the data in your venue and about your customers, and how important it is to achieve new ‘reach’.

Integrate with the Physical Web and your customers are now using a Google product and that product will now have access to data about where your customers are and what kinds of “physical world Web sites” they’re connecting with (although it promises not to share any personally identifiable information from your device).

Integrate with Places, Nearby or its Proximity API and there are other decisions to make.

But this all points to a larger message: that the tools for reaching customers have just become richer, that the era of the app as the primary driver of mobile engagement is coming to an end. You’ll now have more and more tools to reach consumers based on proximity and that’s a very good thing.

And, strangely, and for today anyways, if you want to test out Google’s Physical Web, you’d better get out your iPhone first.

Share Your Thoughts

Join our e-mail list for more on iBeacons and BLE. Join the conversation on Twitter, or connect with me on LinkedIn.

Well….wow huh? What do you think? Call me impressed.

Beacons Meet WiFi: Cisco Meraki Has Its Eye on Connected Spaces

Bluetooth LE beacons have shifted beyond prototypes and pilots into large-scale distribution. But this shift has brought us bumping up against the downside to a beacon’s elegance and simplicity. Because if a beacon is a relatively simple (and dumb) device, how do you intelligently manage them at scale?

One company thinks it has a solution. Meraki, a division of Cisco, launched a WiFi end point which can both act as a beacon and monitor devices in the area, report back to a cloud-based dashboard, and allow you to manage and shape WiFi traffic at the same time.

I spoke recently to the Meraki team. Adam Weis and Simon Tompson gave me an overview of their system and approach. For a company that’s managing massive networks of WiFi end points (70,000 hotel rooms in one case), they know a thing or two about fleet management.

And as beacons shift into distribution at scale, their approach will both help relieve some of the pain of beacon monitoring while offering the possibly larger advantage of being able to shape WiFi traffic and monitor WiFi networks from the same intuitive dashboard.

Beacons Call Home

The beauty of iBeacon (the trademarked term by Apple for its preferred configuration for the open standard of the Bluetooth Smart devices) was its simplicity. Apple did the heavy lifting in thinking about how beacons could be configured, provided easy-to-use software tools to help you create apps, and then stood back while the media branded the beacon industry with the iBeacon brush.

The move by Apple helped to accelerate an industry. By opening up support for beacon detection (and using your phone or tablet to broadcast as a beacon), we finally had a single standard that would work across all the major phone platforms. And by making the tools simple to use, it spurred a wave of innovation and testing which took advantage of the fact that a beacon doesn’t actually do very much.

Like any radio transmitter, a beacon transmits a signal. The signal contains a small packet of data (which also helps protect battery usage on both the beacon and the user’s phone), and that data includes unique ID numbers, some power and battery data, and a signal strength – all of which are used to identify which beacon you’ve detected and how far away you are.

But as the industry rapidly matured, this simplicity also started to show some cracks.

There was a scramble to make developing beacon detection for Android as simple as it was for Apple. And with Apple willing to enforce its trademarks and proprietary specifications, we started seeing separate beacon broadcasting specifications emerge, with a better-known example being the AltBeacon standard.

Beacon manufacturers emerged and took advantage of how relatively simple it was to build a beacon. But their simplicity came at a cost: it’s easy to create a beacon, configure it, put in a coin cell battery, and attach it to your wall.

But the beacons didn’t do much more than their original purpose. They broadcast a signal but they didn’t receive anything. If you wanted to reconfigure them or monitor their battery you needed to use an app while standing next to the beacon.

Your beacons, in other words, had no way to call home.

Managing Beacons at Scale

For a retailer, the idea that you’d deploy thousands of beacons across hundreds of locations and have no simple way to manage or monitor the devices without sending out staff seemed like a non-starter.

In the early days of the industry, more than one beacon company told me that managing your beacons wasn’t necessary: the devices were so cheap you could just throw them out when they died. But try telling that to a national retailer (or even a large museum!). Because the cost of training staff and sending them out to pop a new beacon on the wall was an instant deterrent to large installations.

The solutions included payloads embedded in user apps, extending the battery life through improved beacon performance, embedding beacons in light bulbs, or plugging them in. By making beacons last longer, the need to replace them would decrease.

But it was clear that beacon fleet management would quickly become a differentiator for the companies that could manage it well. Companies like Netclearance Systems launched a cloud management system and Kontakt.io recently launched its Cloud Beacon.

These solutions relied on placing another device in a store or venue: a sort of “hub” which could both call home and send/receive data, and could connect with beacons in the area in order to update their firmware, change their IDs, or monitor their batteries or performance.

In a World of WiFi, We Have An Endpoint

But Meraki thought it had a more elegant solution. Because why add another device to your location when you already need a box for the most pervasive endpoints available: WiFi.

The company has changed the game for how institutions manage WiFi infrastructure – moving us from the dark ages of what often looked like a command line interfaces to an elegant cloud-based solution that had a lot in common with the most intuitive dashboards available.

This was industrial scale WiFi management with a dashboard your mother might even love.

They took the pain out of managing WiFi endpoints. Organizations ranging from universities to hotel chains deploy, manage, monitor, secure and shape traffic for often widely distributed systems – and with Meraki do so in an intuitive way. (They were so successful that Cisco snapped them up).

So Meraki had a simple premise: since you’re already monitoring your WiFi with their endpoints, why not also use that same dashboard to monitor nearby beacons?

And while they were at it, they threw in the capacity of their WiFi box to ACT as a beacon – a boon to a smaller location that might not need a beacon in every aisle but just wants to send a beacon message when you arrive at the front door.

Their solution solved a simple problem: can I easily monitor all the beacons in the area, keep an eye on their batteries and other signals, and do something useful with the data?

Adam Weis, a brilliant guy and someone who helped drive a lot of the thinking behind the Meraki approach, explains:

Is Monitoring and Configuring the Same Thing?

The Meraki system is simple. It has an incredibly elegant and easy-to-use interface. It not only broadcasts as a beacon, but lets you monitor for ALL Bluetooth-enabled devices in its region:

It helps answer one of the more pressing challenges of fleet management: making sure your beacons are still working and that their batteries haven’t run out. By also monitoring other devices in the region, Meraki is providing a richer data set. I can now compare, for example, the number of total devices and then cross-tabulate that data to the number of beacon “app impressions”.

Meraki can’t, however, update a beacon’s firmware or update their UUIDs. To do that, you need to be able to “pair” with the beacon and the pairing is usually handled by tools provided by the beacon manufacturer. In many cases this might not be an issue – but an ideal scenario would be for Meraki to also partner with beacon manufacturers to allow institutions to also PAIR with the beacons via the Meraki dashboard.

In the meantime, it’s where solutions like the Kontakt Cloud Beacon come in – systems to manage your fleet of beacons and their ID numbers, but without the advantage of being a full WiFi endpoint.

WiFi + Beacon Is A Big Win for Many Use Cases

But let’s face it – in many cases, Meraki is enough. A library, for example, probably doesn’t need to swap the UUIDs of its beacons very often and firmware updates aren’t usually deployed, or rarely. And Meraki offers the advantage that it takes care of another key challenge in creating a ‘connected space’ – you need to manage WiFi access as well, shape WiFi traffic, and would prefer to do so in an intuitive way.

If your WiFi network can also ACT as a beacon and monitor the small fleet you have set up in your hotel lobby, say, then you’re getting two for the price of one: an intuitive WiFi management tool, a beacon, and the ability to monitor any additional beacons you place in your space.

Where Technologies Intersect

But there might be something more profound at play.

Because as beacons have shifted into larger deployments, they’ve also shifted into being just one of several technologies being used to ‘digitize physical space’. And it intrigues me to think about a future in which beacon detection can be combined with network monitoring and access management and then be used to shape new kinds of experiences in a location.

Today, you drop by a Starbucks and hop on a WiFi network. But in the future, a combination of beacon interactions and WiFi access might be combined to create new kinds of experiences.

We call beacons the “gateway drug to the Internet of Things”. They’ve been easy to understand. And they open our eyes to a world in which physical space is a new digital touch point. As they start to intersect with other technologies their management will become more complex but the types of interactions we can enable will also become more elegant, more innovative, and hopefully more useful to the end user.

Meraki has shown us one way that beacon technology will start to intersect with others. As we create the digital fabrics of physical space, it’s an early indicator that the beacon era is just getting started.

Share Your Thoughts

Join our e-mail list for more on iBeacons and BLE. Join the conversation on Twitter, or connect with me on LinkedIn.

What other technologies will beacons intersect with? What are the use cases for WiFi and beacon monitoring and where do you see Meraki fitting into your plans? Drop a line below.

Tutorial: Making a Smarter iBeacon Detector on iOS Using PubNub | Guest Post

Apple has been using BLE on its devices since the iPhone 4S. Because of that great head start, using your iPhone to detect beacons is much easier than on any other platform! In fact, Apple’s iBeacon protocol was the first to take advantage of the great qualities of BLE communication.

In our previous tutorials, we walked through an overview of beacon technology and how to build an iBeacon emitter.

In this tutorial, we will make a smarter iBeacon detector (ie. observer)!

Using PubNub and iBeacon, we can create two-way communication while still keeping the low energy asset of beacons! You’ll want to read a little bit on how we plan on doing this, this article will give you a high-level explanation on how our app is supposed to function. This weird, but simple setup increases the capabilities of iBeacons greatly!

We will first look into how to turn your iPhone into an iBeacon in Swift, and we will build the PubNub structure over it!

What are we waiting for? Let’s build amazing apps! This article is inspired by this example app so feel free to use some of its available source code.

 

 

Using your iPhone to detect iBeacons

In the scope of this tutorial, we will build a minimal app on which you can build upon and improve. As a result, we won’t really get into building the user interface. We want to keep it clean and simple.

Setting up your View Controller

First things first, let’s import our libraries.

[snippet id=”368″]

That’s all we’ll need for this.

The variables you’ll need in your view controller are as follows. We’ll talk more about them later on.

[snippet id=”369″]

For the sake of simplicity, we will have most of our application in the viewDidLoad() method. It’s up to you to arrange it as you wish.

[snippet id=”370″]

The first thing we need to do here is create a region element. The beacon region element defines how the proximity to a beacon or a set of beacon should or will look like. What this means in our example is that we are defining beacon regions that have our specified UUID. As a result, when we will detect beacons, we will only detect those with this particular UUID. We could have just as well initiated our region with a UUID, major and minor which would have limited our detection to beacons which satisfy all 3 conditions.

The next step is to create a location manager instance. The location manager is the element that will allow us to use the iPhone’s hardware to start detecting beacons. We will need to set a delegate which will call the location manager’s methods when certain events will be triggered. We set our view controller as the delegate. Don’t forget:

class YourViewController: UIViewController, CLLocationManagerDelegate {

For iOS 8 or more, it is necessary for the app to request the user’s authorization to use location tools. This line usually will not suffice. You have to manually add a couple lines in the info.plist file which is located in the “Supporting Files” directory. If you right click on it and open it as “Source Code”, you want to make sure you add these lines inside the “<dict>” markup.

[snippet id=”371″]

When the user first starts the app, a pop up dialog box will ask the user to authorize location services along with the string we just defined.

We can finally start monitoring for our beacon region!

For now on, our view controller will be waiting for the following events:

  • didStartMonitoringForRegioin
  • monitoringDidFailForRegion
  • didEnterRegion
  • didExitRegion

We will only implement one of those methods:

[snippet id=”372″]

When we started monitoring for regions, we are only subscribing to entering and leaving a region events. In the scope of our app, we need more information. Remember, we want our iPhone to connect to PubNub when we get close enough to a beacon. To save some energy, we will start to range beacons only when we enter a region of interest.

This will trigger a didRangeBeacons:inRegion: method much more frequently than the didEnterRegion method. It will be called as soon as the distance to the beacon changes.

[snippet id=”373″]

Alright! I hope we cleared out the logic for using Apple’s tools to detect our iBeacons. The next step here is to make our iPhone compatible with our smarter emitting beacon. If we want to establish a two-way communication with the beacon, we want to subscribe to the same PubNub channel as soon as we get close enough (you can think that “Near” distance suffice, here we will require to get at “Immediate” distance to start the communication).

Making your iBeacon Smarter with PubNub

Getting Started

The first thing you will need is the pubnub library for iOS.

We are going to use cocoa pods. If you don’t use it yet, you’re missing out. Easy installation and starter’s guide here.

In your project’s root directory

[snippet id=”374″]

Your podfile should look like:

platform :ios, “8.0”
target “YourProject” do
pod ‘PubNub’, ‘3.7.2’
end
target “YourProjectTests” do
end

You can make sure you are using the latest version of pubnub here.

Now you just need to type

$ pod install

Close Xcode, and open the YourProject.xcworkspace .

That wasn’t too hard right? It’s not quite over though.

Use Objective-C libraries in Swift

The pubnub library is written in Objective-C, but we are coding in swift. All you need to do now is to build a bridging header. Create a new Objective-C header in your project called YourProject-Bridging-Header.h for good practice, and type:

[snippet id=”375″]

Now in your project’s configuration panel, go to build settings and scroll down to the “Swift Compiler – Code Generation” section. Set the “install Objective-C Bridging Header” to Yes and in “Objective-C Bridging Header” type the path from your project’s root directory to your bridging header. It’ll be something like “YourProject/YourProject-Bridging-Header.h”


 

All set? Let’s roll.

Initializing PubNub

For the sake of simplicity, we will code our PubNub behaviour on the same view controller.

We will need to add 3 variables to our class:

[snippet id=”376″]

When a user connects to PubNub, he is identified with the content of this PNConfig object. For the scope of this tutorial, we will use demo keys. Get yours here!

In the viewDidLoad method, we will also start PubNub. Add these lines and don’t forget to set your class as a PNDelegate:

[snippet id=”377″]

Awesome! We are connected to PubNub!

We want to use the data advertised by the beacon to subscribe to the beacon’s channel.

Subscribing to the PubNub channel

We need to add a couple line to our didRangeBeacons method in order to subscribe once we get at “Immediate” distance from the beacon:

[snippet id=”378″]

That’s it. We just need to make sure we did not already subscribe to the channel.

[snippet id=”379″]

On the beacon’s side, our subscription event should trigger the beacon to send a message on the channel. We need to implement the method which will be called whenever a message is sent on the channel.

[snippet id=”380″]

Alright! We just received the message! We are good to go. It’s up to you to figure out what you want to do with it.

Finally, when we exit a region, we will want to stop all of these processes:

[snippet id=”381″]

With just a few lines of code, you just created a two-way communication with a beacon while still having a low energy consumption! How great is that? We hope you liked this article.

Next, we’ll build an iBeacon emitter.

Resources

Guest Authors 

Norvan Sahiner and Sunny Gleason wrote this tutorial series on behalf of PubNub, a platform that allows you to build and scale realtime apps for connected devices.

Tutorial: Making a Smarter iBeacon Emitter on iOS with Swift with PubNub | Guest Post

Apple has been using BLE on its devices since the iPhone 4S. Because of that great head start, the iPhone is easier to turn into a beacon than any other platform. In fact, Apple’s iBeacon protocol was the first to take advantage of the great qualities of BLE communication.

In our other tutorials, we walked through an overview of beacon technology and how to build an iBeacon listener (detector).

In this tutorial, we will make a smarter iBeacon emitter! Using PubNub and iBeacon, we can create two-way communication while still keeping the low energy asset of beacons! You’ll want to read a little bit on how we plan on doing this, this article will give you a high-level explanation on how our app is supposed to function. This weird, but simple setup increases the capabilities of iBeacons greatly!

We will first look into how to turn your iPhone into an iBeacon in Swift, and we will build the PubNub structure over it!

What are we waiting for? Let’s build amazing apps! This article is inspired by this example app so feel free to use some of its available source code.

Using your iPhone as an iBeacon

We won’t get into doing the user interface here, we really just want to focus using the iBeacon capabilities of your phone.

Setting up your View Controller

First things first, let’s import our libraries.

[snippet id=”382″]

That’s all we’ll need for this.

Inside our view controller class, we’ll have variables representing the UUID, the major and the minor of our advertised signal.

[snippet id=”383″]

You can chose any uuid or major and minor as long as the uuid is the same as the one you inserted in the app detecting your iBeacon signal.

Start advertising the iBeacon in a region

You need to create a CoreBluetooth peripheral manager which will control the advertising of your data. Don’t forget to set your View controller as a CBPeripheralManagerDelegate.

To simplify our app, we will start our peripheral manager when the view loads.

The first thing we want to do is build a beacon region. This will create an object defining the data you want to advertise: uuid, major, minor.

The next step is to create a peripheral manager instance. The peripheral manager is the element that will allow us to use the iPhone’s hardware to start acting as a beacon. We will need to set a delegate which will call the peripheral manager’s methods when certain events will be triggered. We set our view controller as the delegate. Don’t forget:

class YourViewController: UIViewController, CBPeripheralManagerDelegate {

For iOS 8 or more, it is necessary for the app to request the user’s authorization to use location tools. This line usually will not suffice. You have to manually add a couple lines in the info.plist file which is located in the “Supporting Files” directory. If you right click on it and open it as “Source Code”, you want to make sure you add these lines inside the “<dict>” markup.

[snippet id=”385″]

When the user first starts the app, a pop up dialog box will ask the user to authorize location services along with the string we just defined.

[snippet id=”386″]

Alright, so we generated a dictionary containing the data we want to advertise in the proper format. The region object holds the important data. The measured power argument represents the RSSI power of our emitting device from a meter away. Remember, inside the advertised data, one byte represents this value which is used by the receiver to estimate how far the beacon is. By entering nil, this will return the default RSSI value of your device. That’s probably what you’ll want to do 99% of the time.

Finally we start our CBPeripheralManager. Since we set our View Controller as the delegate, as soon as the manager starts, the peripheralManagerDidUpdateState:peripheral: method of the delegate object (i.e. our view controller) will be called.

[snippet id=”387″]

When the method is called with a powered on state, we can start advertising our data. Its up to you to decide how your app will behave for other states.

And that’s all it takes. Easy, right? Just a couple lines and we can start advertising our data! Beautiful.

The next thing we want to do is make our app magical. That’s where PubNub comes it.

Making your iBeacon smarter with PubNub

Getting Started

The first thing you will need is the pubnub library for iOS.

We are going to use cocoa pods. If you don’t use it yet, you’re missing out. Easy installation and starter’s guide here

In your project’s root directory:

[snippet id=”388″]

Your podfile should look like:

platform :ios, “8.0”
target “YourProject” do
pod ‘PubNub’, ‘3.7.2’
end
target “YourProjectTests” do
end

You can make sure you are using the latest version of pubnub here.

Now you just need to type

$ pod install

Close Xcode, and open the YourProject.xcworkspace .

That wasn’t too hard right? It’s not quite over though.

Use Objective-C libraries in Swift

The pubnub library is written in Objective-C, but we are coding in swift. All you need to do now is to build a bridging header. Create a new Objective-C header in your project called YourProject-Bridging-Header.h for good practice, and type:

[snippet id=”389″]

Now in your project’s configuration panel, go to build settings and scroll down to the “Swift Compiler – Code Generation” section. Set the “install Objective-C Bridging Header” to Yes and in “Objective-C Bridging Header” type the path from your project’s root directory to your bridging header. It’ll be something like “YourProject/YourProject-Bridging-Header.h”

All set? Let’s roll.

Initializing PubNub

For the sake of simplicity, we will code our PubNub behaviour on the same view controller.

We will need to add 2 variables to our class:

[snippet id=”392″]

When a user connects to PubNub, he is identified with the content of this PNConfig object. For the scope of this tutorial, we will use demo keys. Get yours here!

In the viewDidLoad method, we will also start PubNub. Add these lines and don’t forget to set your class as a PNDelegate:

[snippet id=”390″]

We are all set. All we need to do is to define the methods that will be called when events occur on the channel.

There is a long list of methods being triggered for various events, you’ll find it here. We’ll only implement one for our app.

[snippet id=”391″]

When someone joins the channel, the method is triggered and we send a message to the channel that the end user will receive! The message can be any object in the form of a JSON. Here we just send a string, but you could configure the message to have a receiver variable so that only the user who just subscribed receives it.

That’s it! Our iPhone acts like a beacon that emits information to join the PubNub channel. When the customer is close enough to the iBeacon, his phone will subscribe to the advertised PubNub channel. Our beacon is listening for presence events to the channel and immediately sends a message on the channel for the user to see!

Beautiful. Hope you like it. There is so much more you can do with so little code.

Resources

Guest Authors 

Norvan Sahiner and Sunny Gleason wrote this tutorial series on behalf of PubNub, a platform that allows you to build and scale realtime apps for connected devices.

Tutorial: Using Beacon and iBeacon Technologies on Your iPhone / iPad with PubNub | Guest Post

iBeacon has been quite a buzzword since the release of iOS 7 when Apple enabled all their iPhones since the 4S with this new BLE technology.

The iBeacon is simply a protocol that takes advantage of the new Bluetooth Low Energy technologies. It has been easy for companies, aside from Apple, to emulate similar protocols such as estimote or AltBeacon. As a result, we thought iBeacon and PubNub could fit together in some pretty cool ways.

In this article, we will explain how the iBeacon protocol works by taking a closer look at how the emitted data is actually structured. We will move onto how to use the iOS sdk to detect and emit beacons. Finally we will try to see if we can use other protocols on iOS devices.

 

iBeacon Detecto
iBeacon Emitter

 

What an iBeacon’s Advertisement Looks Like

According to the Bluetooth v4 specification, a beacon advertises a data package called the Scan Response Data.

This Data can be up to 31 bytes. If we create a smaller scan response, the remaining bytes will be filled with as many 0s.

The scan response is divided into what are called AD structures. They are sequences of bytes of various size, with a predefined structure that goes as follows:

  • The first byte represents the number of bytes left to the end of the AD structure. This allows a receiver of this structure to know when it ends and when a new AD structure starts.
  • The second byte is the ID of an AD structure type.
  • The rest of the bytes are data that is structured in a predefined way depending on what AD type was defined by the previous byte.

That’s all there is to it. Just a succession of AD structures.

Most beacon protocols have only 2 AD structures, which are as follows.

The first one has 3 bytes:

  • The first byte will be: 0x02 because we only count the following bytes.
  • The second byte is: 0x01 which indicates we have a “Flag” AD type.
  • The last byte represents theses flags. These flags express whether the emitting device is, in “Limited Discoverable Mode”, “General Discoverable Mode”, etc… The byte is computed the following way:

The 5 flags are represented by the first 5 bits of a byte. The value of these bits defines whether the flag is ON or OFF. The binary number is then written as a hexadecimal value which will be advertised. An example may clear things up:

bit 0 OFF LE Limited Discoverable Mode
bit 1 ON LE General Discoverable Mode
bit 2 OFF BR/EDR Supported
bit 3 ON Simultaneous LE and BR/EDR to same Device Capable (controller)
bit 4 ON Simultaneous LE and BR/EDR to same Device Capable (host)

The resulting binary value hence becomes: b00011010 Converted into a hex, we get: 0x1A

That’s all there is to the first AD structure! Let’s look into the second one, which contains most of the information we need!

 

image00

 

The second structure can be of a different size according to the protocol. Let’s look at the detected scan response emitted by an iPhone.

  • First byte is 0x1A (26 in hexadecimal).
  • The next byte is always 0xFF which means we have a “Manufacturer Specific” type of AD structure.
  • As a result, the 2 following bytes represent the company identifier as defined on bluetooth.org. For an iOS device, the manufacturer is “Apple Inc.” whose company ID is 76. In hexadecimal value, this is equal 0x004C. The ID, written as little endian, takes up 2 bytes. Here it will be 0x04C 0x00 in this order.
  • The rest is Manufacturer specific data.

For the iBeacon protocol, the 2 first bytes of the manufacturer specific data are always 0x02 0x15. The next 16 bytes are a UUID representing the advertiser’s organizational unit and the 4 following bytes are going to be the major and the minor. They are 2 bytes long numbers.

There is a final byte at the end of the data structure called the TX Power, which represents the device’s signal reference intensity a meter away from it. This value is held into a single byte which is the two’s complement of the signal’s intensity in dB.

Computing the distance to a Beacon

When a scan response is detected by a device, it also determines the intensity of the received signal. Hence the iBeacon protocol uses the reference value held in the TX Power byte and compares it to the intensity of the signal effectively received. This allows iBeacons to compute an estimation of the distance to the emitting beacon. This is a great quality of iBeacons, but note that the intensity of the signal depends vastly on existing obstacles or simply on the geometry of the room. As a result Apple does not recommend to use iBeacons to determine precise locations.

The algorithm used to compute the distance is not open-source, although others have tried to emulate matching ones.

How to Use Apple’s SDK for iBeacon

Emitting or detecting iBeacon data is organized around iBeacon regions.

 

image01

These regions are instantiated with optional initial values such as the UUID, major or minor. In the case of detecting an iBeacon, this region object defines what type of beacon scan response should be detected. For example, if you provide a UUID, only the beacons with matching UUIDs will be detected, regardless of the major and minor. If you also provide these values, you’ll detect only beacons matching all three of these values.

When emitting an iBeacon signal, the region object based on the values of the UUID, major and minor generates the data structure to be advertised.

As you may have guessed, this makes the iOS SDK very simple to use! For more detailed examples, check out our beacon emitter and beacon detector tutorials.

However, it also makes things much more difficult when you are trying to use a protocol different from iBeacon! Let’s look into that immediately.

Using Apple’s SDK for AltBeacon or Estimote

We have seen how complicated the scan response can be, and how Apple simplified the SDK so that we just need to enter the UUID, major and minor to set it up. However, with other beacon protocols, the scan response has a different structure which Apple makes hard for us to tweak.

Detecting other beacons

When detecting iBeacons, the locationManager:didRangeBeacons:InRegion: method is called on the event of a detected signal. However, this is very specific to iBeacons. When detecting another BLE signal, you must not use a CLLocationManager instance, but a CBPeripheralManager which detects ANY BLE advertisement EXCEPT iBeacons, which will be blocked.

The callback that will be triggered upon detection is centralManager:didDiscoverPeripheral:advertisementData:RSSI: . The advertisement data that is returned is a dictionary holding 2 objects; one for each data structure of the scan response. Here is a sample response from an AltBeacon.

{
kCBAdvDataIsConnectable = 0;
kCBAdvDataManufacturerData = <1801beac 0cf052c2 97ca407c 84f8b62a ac4e9020 00090006 c5>;
}

The top element represents the first, three bytes long, “Flag” data structure. The second one represents the manufacturer specific data following the bytes describing the size and type of the data structure.

This is good news for us, and means we can detect any beacon information!

Emitting another beacon

We have found things are much trickier when it comes to advertising custom beacon scan responses. We can try to build an NSDictionnary similar to the one detected and try to advertise it using the startAdvertising method.

However the advertisement data keys available for detection are limited to only CBAdvertisementDataLocalNameKey and CBAdvertisementDataServiceUUIDsKey when it comes to advertising the data. It is Apple’s way of preventing us from building manufacturer specific data outside of the iBeacon protocol.

So there you have it! We went through apple’s iBeacon protocol, looked at how we could detect other beacons and apple’s restrictions to advertising data. We have some working examples and tutorials to build an iBeacon app on Swift – check out our beacon emitter and beacon detector tutorials, which allow you to get the best out of iBeacons by establishing a two-way communication which beacons aren’t usually capable of. The reason why we think it’s great is that we use PubNub to enhance beacons’ capabilities while still keeping their low energy consumption asset! Sweet, right?

Resources

Guest Authors 

Norvan Sahiner and Sunny Gleason wrote this tutorial series on behalf of PubNub, a platform that allows you to build and scale realtime apps for connected devices.