Beacon functionality in Flutter

瘦欲@ 提交于 2020-07-21 03:04:28

问题


I'm currently building an app that turns my device into a Beacon while simultaneously scanning for other Beacons.

I've currently implemented 2 packages:

  1. flutter_beacon: https://pub.dev/packages/flutter_beacon
  2. beacon_broadcast: https://pub.dev/packages/beacon_broadcast

Everything is working as intended except that I'm broadcasting an AltBeacon and scanning for iBeacon, so my app can't recognize the signal I'm broadcasting.

Is there a package that either broadcasts iBeacon or monitors AltBeacon? Or maybe another way of achieving what I want to achieve? Any advice is greatly appreciated, as I'm stuck and out of ideas.


回答1:


You can change beacon_broadcast to use iBeacon like this;

beaconBroadcast
    .setUUID('39ED98FF-2900-441A-802F-9C398FC199D2')
    .setMajorId(1)
    .setMinorId(100)
    .setTransmissionPower(-59) //optional
    .setIdentifier('com.example.myDeviceRegion') //iOS-only, optional
    .setLayout('m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24') 
    .setManufacturerId(0x004C) 
    .start();

The important changes above are the layout and manufacturer Id.



来源:https://stackoverflow.com/questions/60891624/beacon-functionality-in-flutter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!