Hype, Phonegap (Cordova) and iBeacons


#1

Hi everyone!

I’m nearing the end of a very long project that many of you have helped make happen (Thanks BTW!). I need only one last piece. iBeacons.

I am using Hype to make an app using Phonegap. The final piece of this app is to make it so the Hype scene will change based on which iBeacon it’s near.

I’ve been using Evothings to test and the iBeacons phonegap plugin (https://github.com/petermetz/cordova-plugin-ibeacon) as mentioned in previous posts, but the javascript for connecting them to the Hype API seems to be going over my head.

I have already programed and provisioned the beacons, I just need to figure out how to connect them to hype to change the scenes.

Does anyone have any suggestions or could possibly offer assistance on getting this to work?

Thanks everyone!

L


#2

This example has code to borrow from: https://github.com/divineprog/evo-demos/tree/master/Demos2014/iBeaconDemo

It looks like Beacons are defined based on uuid, and linked with an element ID:

app.beaconRegions =
[
	{
		id: 'page-feet',
		uuid:'A4950001-C5B1-4B44-B512-1370F02D74DE',
		major: 1,
		minor: 1
	},
	{
		id: 'page-shoulders',
		uuid:'A4950001-C5B1-4B44-B512-1370F02D74DE',
		major: 1,
		minor: 2
	},
	{
		id: 'page-face',
		uuid:'A4950001-C5B1-4B44-B512-1370F02D74DE',
		major: 1,
		minor: 3
	}
]

Then from line 100-134, the beacon proximity is linked to simple CSS functions that show or hide information on the next lines: https://github.com/divineprog/evo-demos/blob/master/Demos2014/iBeaconDemo/app.js#L143-L151

If you run the app.js function as a local function within Hype, and you have element IDs corresponding to IDs used in the app.js file like ‘page-feet’, you can get to a starting point with this plugin.

Has anyone else used this plugin?


#3

Another option is Locly: Tumult Hype and iBeacons (Location Aware animations)


#4

Hey Daniel!

In addition to being one of the makes that made this awesome app, you’ve also just earned a spot in the “Special Thanks” credits of my app! That demo example and running it as a Hype function looks like it just may work. I’ll give it a go and let you know!

Thanks!