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

🐛ManufacturerData on iOS returning null, in Android is correctly setted #1229

Open
2 tasks done
Mattefarax opened this issue Aug 1, 2024 · 20 comments
Open
2 tasks done
Labels

Comments

@Mattefarax
Copy link

Prerequisites

  • I checked the documentation and FAQ without finding a solution
  • I checked to make sure that this issue has not already been filed

Expected Behavior

I need to reed the manufacturerData of my device, on Android I can read it normally, on iOS manufacturerData return null.

Current Behavior

I need to reed the manufacturerData of my device, on Android I can read it normally, on iOS manufacturerData return null.

Library version

3.2.1

Device

iPhone 15

Environment info

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1 Pro
  Memory: 150.28 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 21.7.3
    path: /opt/homebrew/bin/node
  Yarn: Not Found
  npm:
    version: 10.5.0
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2024.04.15.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11567975
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 19.0.1
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.6
    wanted: 0.73.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce

Only installing library and add the Multiplatform adapter, then after setting all the permission and add this code line.

Formatted code sample or link to a repository

bleManager.startDeviceScan(null, null, (error, device) => {
      if (error) {
        console.error('Error scanning for devices:', error);
        return;
      }
console.log(device.manufacturerData)

Relevant log output

{ manufacturerData: null,
  isConnectable: false,
  serviceUUIDs: null,
  overflowServiceUUIDs: null,
  txPowerLevel: null,
  solicitedServiceUUIDs: null,
}

Additional information

No response

@Mattefarax Mattefarax added the bug label Aug 1, 2024
@GioIacca9
Copy link

Same problem here, any solution?

@luca-tomasetti
Copy link

luca-tomasetti commented Aug 6, 2024

Isn't it the same problem as here: #1149 ?
@Mattefarax What version of MultiPlatformBleAdapter you have?

@Mattefarax
Copy link
Author

Mattefarax commented Aug 6, 2024

@luca-tomasetti I installed the 0.2.0 using the pods file, and doesn't work. Then I tried to change various version of the library, like the documentation said, but doesn't work.
Are there any other method to install it?

@luca-tomasetti
Copy link

@luca-tomasetti I installed the 0.2.0 using the pods file, and doesn't work. Then I tried to change various version of the library, like the documentation said, but doesn't work. Are there any other method to install it?

@Mattefarax not that I know... Can you share your podfile where you set the MultiPlatformBleAdapter ?

@Mattefarax
Copy link
Author

Mattefarax commented Aug 7, 2024

@luca-tomasetti pod 'MultiplatformBleAdapter', :git => 'https://github.com/dotintent/MultiPlatformBleAdapter', :tag => '0.2.0'

this is the line on my pod file, then I launch the pod update command and successfully installed the library, but doesn't work.
Im using the react-native-ble-plx library version "3.2.1"

@luca-tomasetti
Copy link

I'm using the same...

What OS version you have for your iPhone? I can try to check if I have some hardware with the same version and test it...

@mircotom
Copy link

I encountered the same issue. Not all devices return null for ManufactureData. Out of 200 devices, I was able to retrieve ManufactureData from only 40, whereas on Android, all 200 devices provided ManufactureData.

@luca-tomasetti
Copy link

I encountered the same issue. Not all devices return null for ManufactureData. Out of 200 devices, I was able to retrieve ManufactureData from only 40, whereas on Android, all 200 devices provided ManufactureData.

Weird... Is there any consistency with the devices ? Like OS Version, model, year, ...

@mircotom
Copy link

After decoding the manufacturer data and converting the first two bytes to the actual company names using the information from "https://bitbucket.org/bluetooth-SIG/public/raw/HEAD/assigned_numbers/company_identifiers/company_identifiers.yaml".
I found that the additional devices detected by Android are mostly Apple devices. This suggests that the iOS SDK cannot capture Apple devices, whereas Android can.

@GioIacca9
Copy link

Did some tests with a third-party app (eBeacon) and there the beacon's manufacturer data is visible, may it be not related to the SDK? Strangely enough on that app only beacons from Apple (0x004C) are detected. Don't know if that's a setting or something else.

IMG_0037

@mircotom
Copy link

mircotom commented Aug 22, 2024

@GioIacca9
I couldn't find the Manufacturer Data in your snapshot. In iOS,there are two frameworks used for communicating with Bluetooth devices: CoreBluetooth and CoreLocation. CoreLocation is used to detect nearby beacon devices, so it can discover Bluetooth devices, but it cannot retrieve Manufacturer Data from them. The CLBeacon class only provides uuid, major, minor, proximity, accuracy, and rssi attributes. You can find more details here:https://developer.apple.com/documentation/corelocation/clbeacon.

On the other hand, CoreBluetooth allows you to directly process Bluetooth data packets, including Manufacturer Data.

@GioIacca9
Copy link

@mircotom thank you for the explanation. I thought that Major and Minor values were included in the manufacturer data, my goal is to get those numbers. On android I semply base64-decode the manufacturer data and get the 25-26 bytes for the major value and 27-28 bytes for the minor value, but if there's another way to obtain those two vlaues I'm ok with that.

@luca-tomasetti
Copy link

When you use the startDeviceScan() function, what are you setting in the allowDuplicates option field?

@Mattefarax
Copy link
Author

This is my startDeviceScan function:

bleManager.startDeviceScan(null, null, (error, device)

@luca-tomasetti
Copy link

Can you check what happen if you set the option allowDuplicates=true?

bleManager.startDeviceScan(null, {allowDuplicates: true}, (error, device)

@Mattefarax
Copy link
Author

Didn't change. Manufacturer Data is null.

@tom501
Copy link

tom501 commented Aug 26, 2024

Didn't change. Manufacturer Data is null.

I'm assuming manufacturedData is null even if you set allowDuplicates to false...

@Mattefarax
Copy link
Author

Exactly, I changed to false and manufacturedData is already null

@Mattefarax
Copy link
Author

Hi @tom501, do I need to change some configuration modes on Xcode application to let the library works correctly?

Screenshot 2024-09-02 alle 09 25 02

@tom501
Copy link

tom501 commented Sep 2, 2024

@Mattefarax I have a similar configuration...

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

No branches or pull requests

5 participants