cordova-plugin-bluetoothle icon indicating copy to clipboard operation
cordova-plugin-bluetoothle copied to clipboard

How can I have the right Mac address on getAdapterInfo method? Always returning "02:00:00:00:00:00"

Open elysiopires opened this issue 6 years ago • 6 comments

After install the plugin I tried to get the mac address of my current device by executing: bluetoothle.getAdapterInfo(function(ren){console.log(ren);},function(ren){console.log(ren);});

and I received as a response at all devices: address: "02:00:00:00:00:00" isDiscoverable: false isEnabled: true isInitialized: true isScanning: false name: "Galaxy Tab A (2017)"

I just install the plugin... Am I missing something to get the right address?

Thx in advance!

Best, Elysio

elysiopires avatar Oct 04 '18 17:10 elysiopires

Android removed the ability to obtain the device MAC address in Marshmallow or above. https://developer.android.com/about/versions/marshmallow/android-6.0-changes#behavior-hardware-id The plugin will need to be modified to account for these changes as it now requires more "user comprehensible" permission requests.

Since the MAC address can be used to uniquely identify a user for tracking purposes the required permission prompts the user that the app will require the exact location of the device

Maximvdw avatar Nov 08 '18 13:11 Maximvdw

What type of modifications to the plugin are you expecting? There's already support for requesting finer grained location permissions.

randdusing avatar Dec 21 '18 00:12 randdusing

I'm facing the same issue and as a result my device isn't discoverable. Any progress?

adamalexander avatar Jan 07 '19 20:01 adamalexander

@randdusing Hello, has this problem been solved? Android 6.0 can't get the real MAC address

MrLrx avatar Mar 25 '20 02:03 MrLrx

@elysiopires Has your problem been solved?

MrLrx avatar Mar 25 '20 02:03 MrLrx

No! After android 6 they implemented security policies that prevent you to access this information.

Best, Elysio

On Tue, Mar 24, 2020 at 7:20 PM MrLrx [email protected] wrote:

@elysiopires https://github.com/elysiopires Has your problem been solved?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/randdusing/cordova-plugin-bluetoothle/issues/504#issuecomment-603602774, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA76ZADKIQLXFTQL5ORWLDDRJFS6HANCNFSM4FZCNZCQ .

elysiopires avatar Mar 25 '20 13:03 elysiopires