Code Monkey home page Code Monkey logo

cordova-plugin-ibeacon's People

Contributors

aircable avatar alexanderkustov avatar austinhaigh avatar biggins avatar chuckytuh avatar darrenahunter avatar deton avatar dopry avatar emilingerslev avatar halindrome avatar jmesa-sistel avatar josandretto avatar jpuerto avatar junchangchen avatar king-infet avatar machty avatar mgrubinger avatar mkyukov avatar mrtree1 avatar na0ki avatar olegdeezus avatar olierxleben avatar petermetz avatar ritzlgrmft avatar rodrigograca31 avatar ronmen avatar sunsus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-ibeacon's Issues

Provide distance data for beacons, where available

The distance related fields should be made available to the DOM by the native layer when passing the plugin result objects through the delegate methods.

Right now the model does not contain those fields, so the missing fields have to be added.

Edit: The model defined in the DOM had nothing to do with this.

Can't get the plugin to work

I'm new to Cordova, I tried this plugin in iOS and Android and neither worked, I must be doing something wrong...

I took the example code on the Readme for a ranging iBeacon, changed the UUID, minor and major values with the ones from my iBeacon, ran the application and it does nothing. I tried to get the iBeacon outside the rage of the phone and in again and noting happened...

Is there a way to list all iBeacons in range? Or any fully working example?

iOS 7.1.1 does not pick up beacon.

I have a device using iOS 7.0.1 and the ranging and tracking of beacons works, but when I put the same app on my phone that's running 7.1.1 the ranging stops working (callbacks no longer fire).

UUID Validation

Hi, thanks for the plugin.

I want to use my beacons that comes pre configured with certain UUID that does not validates with the regex in BeaconRegion.js.

getUuidValidatorRegex: function () {
    return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
},

I can't found any restriction to no use any values for the advertisement UUID, could it be simplified?

getUuidValidatorRegex: function () {
    return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
},

I've replaced it in local and seems to work without problems. What's the reason to restrict the UUID values?

Version 2 background scanning?

Hello. In this issue #5, it was mentioned that version 2 would have better background scanning functionality when the app is closed. Has this been tested? How is this implemented via javascript?

Thanks!

Bug when ranging multiple beacons.

Created 3 beacons with different UUIDs and started monitoring all of them.
When I turned on my device beacons with the corresponding UUIDs the ranged callback only fires (usually) for the last beacon I started monitoring.

If I stop monitoring all of them and then range each beacon individually the beacons range properly.

iBeacon with ionic framework (angularJS)

Hi Peter,

Thank you for the iBeacon plugin. I start playing with it few days ago and I couldn't figure out how to use it correctly. Here is the code that I have included

angular.module('myApp', ['ionic', 'myApp.controllers', 'myApp.services']).run(function($ionicPlatform, $rootScope, $ionicPopup, $ionicModal, $http, $ionicLoading) {
  $ionicPlatform.ready(function() {
    function createBeacon() {
      var uuid = 'E20A39F4-73F5-4BC4-A12F-17D1AD07A961'; // mandatory
      var identifier = 'our identifier'; // mandatory
      var minor = 0; // optional, defaults to wildcard if left empty
      var major = 0; // optional, defaults to wildcard if left empty
      // throws an error if the parameters are not valid
      var beaconRegion = new cordova.plugins.locationManager.BeaconRegion(identifier, uuid, major, minor);

      return beaconRegion;
    };
    //
    //
    var logToDom = function (message) {
      console.log(message);
    };

      var delegate = new cordova.plugins.locationManager.Delegate().implement({

          didDetermineStateForRegion: function (pluginResult) {

              logToDom('[DOM] didDetermineStateForRegion: ' + JSON.stringify(pluginResult));
          },

          didStartMonitoringForRegion: function (pluginResult) {
              logToDom('didStartMonitoringForRegion:' + JSON.stringify(pluginResult));
          },

          didRangeBeaconsInRegion: function (pluginResult) {
              logToDom('[DOM] didRangeBeaconsInRegion: ' + JSON.stringify(pluginResult));
          }
      });

    //
    var beaconRegion = new beaconRegion();
    cordova.plugins.locationManager.setDelegate(delegate);
    cordova.plugins.locationManager.startMonitoringForRegion(beaconRegion)
        .fail(console.error)
        .done();
  });
})

The error I receive from the xcode console is :
[Cordova-Plugin-IBeacon] WARNING did not receive delegate ready callback from DOM after 30.000000 seconds!

Do you have an idea about how to solve the issue. Am I doing something wrong? Thank you very much for your help.

Detected beacon accuracy is rounded to 2 decimals. Let us do this in JS when it's necessary please.

// accuracy is a rough estimate of distance in metres. capped to two decimal places
NSNumber *accuracy = [NSNumber numberWithDouble:round(100*beacon.accuracy)/100];
[dict setObject:accuracy forKey:@"accuracy"];

    // accuracy = rough distance estimate limited to two decimal places (in metres)
    // NO NOT ASSUME THIS IS ACCURATE - it is effected by radio interference and obstacles
    dict.put("accuracy", Math.round(region.getAccuracy()*100.0)/100.0);

Why is this done in the LocationManager classes? Please let us do this in JavaScript when we think it's necessary (and therefore send the uncapped values to the JS side).

We're creating an app that requires us to have triggers for 0.0015 accuracy, which we cannot have due to the rounding.

any way to scan any ibeacons nearby?

I see the sample code for plugin is about monitoring one particular beacon's uuid, is it possible to scan for any iBeacons getting in the region?

Setting beacon proximity

If you are using this plugin, how do you set the beacon proximity? Do I have to use the beacon manufacture's dash to make the change? Can I make this change using the plugin? For example I would like to change a beacon proximity from immediate to far.

Detect if Bluetooth is enabled

Is there a method to detect if the device has bluetooth turned on, so I can have my app throw an error message when needed?

Ranging beacons HELP :(

Hi everyone!

I'm trying to range beacons by altering what happens when 'didRangeBeaconsInRegion' is called, but I am unsure of what is passed through 'pluginResult'.

I am essentially trying to get the closest beacon out of the beacons that are detected from the region currently being monitored and check to see if it is within a certain proximity like the 'near' that is documented in the Apple Location documentation.

Any help with this topic is greatly appreciated! :)

Thank you,

radman5

Android build error: Unable to execute dex: Multiple dex files

his iBeacon plugin works very well on iOS. When I attempt to run on Android I get the following error: Dex Loader] Unable to execute dex: Multiple dex files define Lcom/radiusnetworks/ibeacon/IBeaconConsumer;

Don't undeerstand?

Any suggestions are appreciated.

Thanks!

[Question] Behaviour of iBeacon when the app is not running

Things work properly when the app is running or in background.
I am able to get the status when the phone enters the region or leaves it.

The problem is that when the app is not running(after killing it/after reboot ), I don't get any status. It doesn't detect anything.
Is this expected or is there any setting that I need to use to get the status when the app is not running.

Optional minor/major parameter

The code examples in the README promise that the minor/major parameters are optional. But if you don't provide them, an error gets thrown.

Is this intended?

Android AltBeacon library update

With the withdrawal of the RadiusNetworks iBeacon library for Android (it appears to avoid IP conflict), there is no direct iBeacon library for Android. The guys at Radius have come up with a variant on iBeacon and their library is now nativelt supporting these AltBeacons. The library does have support for iBeacons albeit undocumented. As this is the only viable option for Android support, we need to migrate to the AltBeacons library and implement iBeacon support.

This will mean iBeacon and AltBeacon support will be available on Android. Support for AltBeacons on iOS may come along as well, but I'm a bit concerned about the lack of OS level support, as it would have to be managed via CoreBluetooth directly.

Is it possible to find out ibeacon list automatically with this plugin?

Hello.
I hope you are find and doing great.
I just want to know it is possible to detect nearest ibeacon list without specific UDID.
In the other words, I want to detect all ibeacons with all information automatically.
Look forward to your hearing.
Thanks for your help.

Sirius2013

IOS8 breaks the plugin

I upgraded to IOS 8 and U stopped receiving notifications. Any idea what the problems is? I was receiving notifications before the update. I am on Xcode 6.0.1 and OSX 10.9.4. I do see an error message "registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.". I also use Pushwoosh for Push notifications not iBeacons.

Add support for notifyOnEntry, notifyOnExit parameters

CLRegion.h defines these parameters below.
Goal: Expose these properties for the Javascript runtime via the plugin.

/*
 *  notifyOnEntry
 *
 *  Discussion:
 *    App will be launched and the delegate will be notified via locationManager:didEnterRegion:
 *    when the user enters the region. By default, this is YES.
 */
@property (nonatomic, assign) BOOL notifyOnEntry __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0);

/*
 *  notifyOnExit
 *
 *  Discussion:
 *    App will be launched and the delegate will be notified via locationManager:didExitRegion:
 *    when the user exits the region. By default, this is YES.
 */
@property (nonatomic, assign) BOOL notifyOnExit __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0);


Unable to 'phonegap build ios'

Errors:

The following build commands failed:
    CompileC build/ibeacon.build/Debug-iphonesimulator/ibeacon.build/Objects-normal/i386/TtsPlugin.o ibeacon/Plugins/com.lefortsoftware.ttsplugin/TtsPlugin.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    CompileC build/ibeacon.build/Debug-iphonesimulator/ibeacon.build/Objects-normal/i386/CDVLocationManager.o ibeacon/Plugins/com.caresolutions.ibeacon/CDVLocationManager.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    CompileC build/ibeacon.build/Debug-iphonesimulator/ibeacon.build/Objects-normal/i386/AppDelegate+CDVLocationManager.o ibeacon/Plugins/com.caresolutions.ibeacon/AppDelegate+CDVLocationManager.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    CompileC build/ibeacon.build/Debug-iphonesimulator/ibeacon.build/Objects-normal/i386/LMLogger.o ibeacon/Plugins/com.caresolutions.ibeacon/LMLogger.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler

cordova / xcode demo

Possible to post a basic cordova app shell demoing this? Something as simple as console logging a beacon would be helpful.

Thanks.

iOS background monitoring when app is killed

Hi,
the plugin is working great so far but now we are trying to find out how we can react to region changes on iOS when our Application got killed (really killed, not just in the background).

According to the documentation from Apple when an Application is registered for a Region which changes, the Application gets started in the background, has to set up a LocationManager and then gets the Event (didEnterRegion).
So how does this work here? (or does it work?)

Is it enough when we add a new delegate (I guess not because it didn't work so far) or do we have to call "startMonitoringForRegion" with the region as well? Do we have a way to distinguish between a normal start and a 'region change background start'? Because if not, we would have to initialize the whole application every time.

In this thread it looks like it's possible (someone did it) but we haven't had any luck yet ...

Thanks in advance for input on this subject!

Android support

Add support for the Android platform

  • Figure out what dependencies, permission requirements, etc. it has
  • Have a look at others implementations
  • If possible, keep the Javascript API as it is (not sure yet if this makes sense)
  • Figure out what is the optimal API level to support initially

Breaks other plugins

Hi,

I am developing a cordova application that is utilizing several plugin (barcode scanner / push notif / etc).
The application using only the plugins above works perfectly. I've tested the ibeacon plugin on a separate app and it performs as expected. However, when I add the ibeacon plugin to the big project, suddenly the other plugins stop working - e..g barcode scanner doesn't start.
This is very strange behaviour. Has anyone came across this?

Phonegap Build

Hi,

Just wanted to say great work, really helped me understand apples Ibeacon stuff,

just wandering if you or anyone else has submitted this to PhoneGap Build successfully ? i can't find the plugin on phonegap build when i search for it, but trying to submit it says a plugin with thesame id already exists.... ?

Cheers
Niro

build failed

Hello,

I just get this failed info, any idea about that?

no such file or directory: './platforms/ios/ibeacon/Plugins/org.apache.cordova.ibeacon/LMLogger.m'

Thanks!

Problem with Cordova DOM / message processing

Experiencing some kind of run-time problem just by including the plugin in a simple Cordova ( 3.5.0-0.2.4 ) Android project.
I suspect that this leads to at least another problem that I am observing on a real project where I use other plugins and all of a sudden things start to malfunction. ( The concrete conflict is related to an Ionic keyboard plugin - https://github.com/driftyco/ionic-plugins-keyboard ). So DOM, events related, something blocking execution?

image

Made a demo project that shows the behavior ( it's really the "Hello Cordova" application ). See the included readme.txt to get going. After having the app installed and run on a Nexus 5 ( Android 4.4.4 ), the error pops up after about 30 seconds in the chrome://inspect console window for the application. It's enough to just keep the application open and not interact with it.

https://www.dropbox.com/s/39yv9dl5sktln7u/hellobeacon.zip

Detect Ibeacon

Hi
I have an ibeacon with me. I am using android. I want to write a code so as to detect the ibeacon. Do I need to call any function or Do I have to write my own code for this purpose.

Android 4.4.2 compatibility question

I've got a new device with Android 4.4.2 and BLE support but unfortunately it's not working properly. The problem is that the advertisement packet is empty, I've enabled the debug mode in the RadiusNetwork library and found the following:

D/ActivityThread(14570): SVC-CREATE_SERVICE handled : 0 / CreateServiceData{token=android.os.BinderProxy@41da9d08 className=com.radiusnetworks.ibeacon.service.IBeaconService packageName=ch.becompany.bebeacon intent=null}
D/ActivityThread(14570): SVC-BIND_SERVICE handled : 0 / BindServiceData{token=android.os.BinderProxy@41da9d08 intent=Intent { cmp=ch.becompany.bebeacon/com.radiusnetworks.ibeacon.service.IBeaconService }}
D/IBeaconService(14570): Waiting to stop scan for another 1100 milliseconds
D/IBeaconService(14570): Scan started
D/IBeaconService(14570): got record
D/IBeacon (14570): This is not an iBeacon advertisment (no 0215 seen in bytes 4-7).  The bytes I see are: 0201000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
D/IBeaconService(14570): got record
D/IBeacon (14570): This is not an iBeacon advertisment (no 0215 seen in bytes 4-7).  The bytes I see are: 0201000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Same application with my previous phone worked:

D/IBeaconService( 1988): got record
D/IBeacon ( 1988): calculating accuracy based on rssi of -74.0
D/IBeacon ( 1988):  avg rssi: -74.0 accuracy: 5.9970034053596795
D/IBeaconService( 1988): iBeacon detected :72676723-7400-0000-ffff-0000ffff0000 0 1001 accuracy: 5.9970034053596795 proximity: 3
D/IBeaconService( 1988): This region does not match: proximityUuid: b9407f30-f5f8-466e-aff9-25556b57fe6d major: null minor:null
D/IBeaconService( 1988): This region does not match: proximityUuid: 9e4c353b-b566-522b-b746-194ec3706f4a major: null minor:null
D/IBeaconService( 1988): looking for ranging region matches for this ibeacon
D/IBeaconService( 1988): matches ranging region: proximityUuid: 72676723-7400-0000-ffff-0000ffff0000 major: null minor:null
D/IBeaconService( 1988): got record

I've used also the BluetoothLE plugin from randdusing:

4.4.2

D/CordovaLog(21519): file:///android_asset/www/js/index.js: Line 74 : scanResult {"advertisement":"AgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=","status":"scanResult","address":"34:B1:F7:CE:84:BE","rssi":-79}
D/CordovaLog(21519): file:///android_asset/www/js/index.js: Line 74 : scanResult {"advertisement":"AgEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=","status":"scanResult","address":"34:B1:F7:CE:81:8F","rssi":-79}

4.3

D/CordovaLog( 1896): file:///android_asset/www/js/index.js: Line 74 : scanResult {"advertisement":"AgEaGv9MAAIVcmdnI3QAAAD//wAA//8AAAAAA+rGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=","status":"scanResult","address":"34:B1:F7:CE:81:8F","rssi":-88}
D/CordovaLog( 1896): file:///android_asset/www/js/index.js: Line 74 : scanResult {"advertisement":"AgEaGv9MAAIVcmdnI3QAAAD//wAA//8AAAAAA+jGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=","status":"scanResult","address":"34:B1:F7:CE:84:BE","rssi":-71}

Does anybody experienced this issue before? I don't have another 4.4.2 device for testing so I wonder if the problem is the device or a bug in the plugin.

Ranging Multiple beacons in new version

I can't seem to get this to work. I am using the example from the last version, adapting it for the changes of v2.

Here is my sample code.

    var beaconRegion1 = createBeacon();
    var beaconRegion2 = createBeacon2();
    var beacons = [beaconRegion1, beaconRegion2];

    cordova.plugins.locationManager.setDelegate(delegate);

    var beaconRange =   cordova.plugins.locationManager.startRangingBeaconsInRegion(beacons);

'beaconRange' throws an error. The exact same code works perfectly with one instance of createBeaconn (ie. if I replace beacons with beaconRegion1). Any ideas?

phonegap debug

First i loaded a simple app into phonegapbuild using the plugin
<gap:plugin name="com.conetix.ibeacon" version="1.0.0" />

by pasting the exact sample code in the weinre debug tools console on phongapbuild it returns the following error.

TypeError: Cannot read property 'locationManager' of undefined

I do have the <script src="cordova.js"></script> called out in my index so why would it not see this?

Question - ibeacon ranging behavior

Hi Guys,

just a question if you could help me understand - This plugin is essentially replicating the beacon region functionality of the CoreLocation on IOS for android in a way right ? (sort of?)

My understanding based on testing i have done and looking at other plugins

Android you can scan and find any beacon, and it returns the MAC address along with the scan record which is the raw data the beacon advertises which you could use to parse Proximity UUID, Major , Minor etc. But in IOS you need to use CoreLocation and submit your proximity UUID and Major / Minor and it will tell you when it finds a beacon with that UUID / Major / Minor ?

Hopefully i have this correctly, i only have one Ibeacon at the moment and i have tested this plugin using your sample code on an Android phone where i passed in the Proximity UUID and Major Minor and it told me when i entered the "beacon region" and when i left it (simulated by turning the power off to the beacon). I will test it with more beacons tonight but was wandering - if i had multiple beacons and i wanted to know when i was close to them how should it work ?

a) Have all the beacons share the same proximity UUID and different Major / Minor values, would then creating a BeaconRegion as you call it with only the UUID and no Major and Minor values return a callback every time it finds any beacon with the same proximity UUID ? would it return multiple callbacks for each beacon along with the Major Minor so that i can distinguish which beacon i am close to ? Is this how Apple Sees ibeacons working ?

b) Regardless of the proximity UUID being the same or different, create multiple BeaconRegions for each beacon and monitor them that way ?

Any help to understand this would be much appreciated!

Cheers
Niro

Estimote beacon?

Hi,
I am looking for a plugin that would work with android, phonegap and the Estimote Beacons. Is this plugin compatible with these?

Many Thanks,

Support for configuring the iOS device as a bluetooth beacon

Hi Peter,

for an App prototype I'm working on I need library support for configuring the iOS device itself as a bluetooth beacon and to be able to advertise it to other beacons around.

Documentation of CLBeaconRegion class says:
"If you want to configure the current iOS device as a Bluetooth beacon, create a beacon region with the appropriate identifying information. You can then call the peripheralDataWithMeasuredPower: method of the region to get a dictionary that you can use to advertise the device with the Core Bluetooth framework. For more information about using that framework to advertise the device as a beacon, see Location and Maps Programming Guide."

If it helps, I can offer you a payment/donation if you could do that implementation please.

Thanks and regards,
Aron

Mandatory major and minor identifier mandatory

Why are the major and minor parameters mandatory. In the official apple documentation I thought you could just scan on a uuid and you can specificly now which beacon you have by checking its major and minor. Is it possible to modify the plugin so only the uuid is mandatory?

How do I get rssi?

The rssi is not included in the pluginResult. How do I get it? It's kinda pointless to monitor beacon and not be able to tell how far it is.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.