Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startMonitoringForRegion without major and minor #1

Closed
marcoacierno opened this issue Feb 22, 2017 · 15 comments
Closed

startMonitoringForRegion without major and minor #1

marcoacierno opened this issue Feb 22, 2017 · 15 comments

Comments

@marcoacierno
Copy link

marcoacierno commented Feb 22, 2017

Version

1.0.1

Platform

Android

OS version

android 5.0

Steps to reproduce

  1. Call startMonitoringForRegion with only identifier and UUID. Example:
Beacons.startMonitoringForRegion({
    identifier: 'region',
    uuid: 'MY-UU-ID-HELLO-0001111000',
});

Expected behavior

The app should start monitoring

Actual behavior

The app "crashes" with a redbox error and the message: 'TypeError: expected dynamic type 'double' but had type 'null' (constructing arguments for BeaconsANdroidModule.startMonitoring at argument index 2)'

It looks like it doesn't handle well an undefined major/minor in startMonitoringForRegion.

(Note: I'm using react-native-ibeacons but I guess I will have the same problem with this version too?)

@MacKentoch
Copy link
Owner

MacKentoch commented Feb 22, 2017

Hi @marcoacierno

Thank you for this complete and helpful issue.
You are right this is exactly the same as react-native-ibeacons for this version.

minor and major are optionals but the bridge clearly does not handle that.
To be honest I did not even test myself with null major / minor.

I will fix it.
It can be useful to be able to monitor or range multiple beacons sharing same UUID.

@MacKentoch
Copy link
Owner

Going deeper into monitoring reveals that there is more to be updated.

I suspect it comes from side effects after upgrading altbeacon.
It will take more time than I thought but is is ok.

@Davidcreador
Copy link

Hello @MacKentoch! I was trying to do the same and it didn't work. :(
Do you have any update on this? If I can help you with something I'd love to.

@MacKentoch
Copy link
Owner

hi @Davidcreador thank you.
But don't worry I get it working.
I just need to test a bit more but I'm sure it was just about passing null from React Native to an int is not working as expected.

@MacKentoch
Copy link
Owner

Glad to annonce: I've just publish new version v1.0.2 to fix android monitoring with major and minor set as null.

Check android example that I updated to validate the fix.

Note: monitoring is slow compared to regioning.
In case of leaving event it can take few seconds to trigger.

I don't know if it is expected behaviour but it comes from altbeacon.

Thank you for your feedbacks and issues = precious help!

@marcoacierno
Copy link
Author

Amazing! Thank you :) I will update my version / try it as soon as I can. ^^ (I guess we can close the issue?)

@FilipMessa
Copy link

FilipMessa commented Mar 2, 2017

Hi i have same issue with new version v1.0.2
i try run your example project on Android 6.0.1

TypeError: expected dynamic type 'double' but had type 'null' (constructing arguments for BeaconsANdroidModule.startMonitoring at argument index 2)'

@MacKentoch
Copy link
Owner

MacKentoch commented Mar 2, 2017

Hi @FilipMessa I'm sorry I thought it was fixed.

I tested on real device (it is mandatory) and mine is a Nexus 5X (up to date: 7.1.1).

I doubt it is a matter of android version.
But may I ask you a favor to help understanding where should I put more effort to fix it:

could you try to launch the example here on the same condition (your device with Android 6.0.1)?

This example is the what I exactly use when working on this library.
It could be nice to compare your experience with your own device.

@marcoacierno I'm affraid we can't close this issue right now... But it is just a matter of time 😄

@FilipMessa
Copy link

FilipMessa commented Mar 3, 2017

Hi, i have been trying your example, but still had the same result:
TypeError: expected dynamic type 'double' but had type 'null' (constructing arguments for BeaconsANdroidModule.startMonitoring at argument index 2)'

Device:
ANDROID: 6.0.1
Samsung Galaxy S4 GT-I9505

@MacKentoch
Copy link
Owner

MacKentoch commented Mar 3, 2017

Thank you @FilipMessa for the precious feedback.

I will investigate:

  • wether I messed myself when publishing (why not)
  • or it is related to some kind compatibility between altbeacon and android 6 (I should easily find an android devices with this version).

Anyway it will be fixed (not only I maintain this lib but I need it working too).

@MacKentoch
Copy link
Owner

I've tested the example on a 6.0 android: no error BUT nothing working...

So I guess I have to envistigate altbeacon library compatibility.
Things are always far more simple on iOS (yes I come from iOS^^).

@FilipMessa
Copy link

FilipMessa commented Mar 6, 2017

I understand you iOS is more developer friendly than Android in most cases. Anyway i would like to thank you for your job on this module.

I have tried write my own BeacnsScaner componet and when i Use:
startMonitoringForRegion() without minor and major i have had these error: Error: Unable to parse Identifier. And when i put minor and major also to regionargument, it is not working and no error (as you mention before).

Device:
ANDROID: 6.0.1
Samsung Galaxy S4 GT-I9505

@MacKentoch
Copy link
Owner

@FilipMessa I think I should investigate in this way: react-native-beacons-android issue with android 6.

It seems like it is a matter of Permission.

@MacKentoch
Copy link
Owner

MacKentoch commented Mar 12, 2017

@FilipMessa good news.

I made it working on android 6 with the example without touching any byte of code.

It is really stupid simple 😮

Sorry I forgot (my Nexus phone is android 7+ since a while so I forgot about 6).

You simply just have to active location service (aka GPS) in addition to bluetooth service in android 6.

@MacKentoch
Copy link
Owner

I close the issues that is fixed for a while but had a doubt for android 6 not working (just active location service on android < 7).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants