{"id":17154106,"url":"https://github.com/alann-maulana/flutter_beacon","last_synced_at":"2025-04-05T03:10:03.113Z","repository":{"id":47330723,"uuid":"163078068","full_name":"alann-maulana/flutter_beacon","owner":"alann-maulana","description":"An hybrid iBeacon scanner and transmitter SDK for Flutter Android and iOS.","archived":false,"fork":false,"pushed_at":"2024-09-03T20:59:06.000Z","size":6443,"stargazers_count":122,"open_issues_count":64,"forks_count":168,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-29T02:06:33.654Z","etag":null,"topics":["beacon","beacon-scanner","beacon-transmitter","flutter-beacon","flutter-plugin"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alann-maulana.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-25T11:47:41.000Z","updated_at":"2025-03-22T13:55:51.000Z","dependencies_parsed_at":"2024-10-31T13:03:18.357Z","dependency_job_id":"47059822-7eb5-43d6-99d7-474551ad349d","html_url":"https://github.com/alann-maulana/flutter_beacon","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alann-maulana%2Fflutter_beacon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alann-maulana%2Fflutter_beacon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alann-maulana%2Fflutter_beacon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alann-maulana%2Fflutter_beacon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alann-maulana","download_url":"https://codeload.github.com/alann-maulana/flutter_beacon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247280272,"owners_count":20912967,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beacon","beacon-scanner","beacon-transmitter","flutter-beacon","flutter-plugin"],"created_at":"2024-10-14T21:48:15.568Z","updated_at":"2025-04-05T03:10:03.083Z","avatar_url":"https://github.com/alann-maulana.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flutter Beacon\n\n[![Pub](https://img.shields.io/pub/v/flutter_beacon.svg)](https://pub.dartlang.org/packages/flutter_beacon) [![GitHub](https://img.shields.io/github/license/alann-maulana/flutter_beacon.svg?color=2196F3)](https://github.com/alann-maulana/flutter_beacon/blob/master/LICENSE) [![Build](https://github.com/alann-maulana/flutter_beacon/workflows/Flutter%20CI/badge.svg)](https://github.com/alann-maulana/flutter_beacon/actions?query=workflow%3A%22Flutter+CI%22) [![Coverage Status](https://coveralls.io/repos/github/alann-maulana/flutter_beacon/badge.svg?branch=master)](https://coveralls.io/github/alann-maulana/flutter_beacon?branch=master)  [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Falann-maulana%2Fflutter_beacon.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Falann-maulana%2Fflutter_beacon?ref=badge_shield) [![codecov](https://codecov.io/gh/alann-maulana/flutter_beacon/branch/master/graph/badge.svg)](https://codecov.io/gh/alann-maulana/flutter_beacon) \n\n[Flutter plugin](https://pub.dartlang.org/packages/flutter_beacon/) to work with iBeacons.  \n\nAn hybrid iBeacon scanner and transmitter SDK for Flutter plugin. Supports Android API 18+ and iOS 8+.\n\nFeatures:\n\n* Automatic permission management\n* Ranging iBeacons  \n* Monitoring iBeacons\n* Transmit as iBeacon\n\n## Installation\n\nAdd to pubspec.yaml:\n\n```yaml\ndependencies:\n  flutter_beacon: latest\n```\n\n### Setup specific for Android\n\nFor target SDK version 29+ (Android 10, 11) is necessary to add manually ```ACCESS_FINE_LOCATION```\n\n``` \n\u003cuses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/\u003e\n```\n\nand if you want also background scanning: \n```\n\u003cuses-permission android:name=\"android.permission.ACCESS_BACKGROUND_LOCATION\" /\u003e\n```\n\n### Setup specific for iOS\n\nIn order to use beacons related features, apps are required to ask the location permission. It's a two step process:\n\n1. Declare the permission the app requires in configuration files\n2. Request the permission to the user when app is running (the plugin can handle this automatically)\n\nThe needed permissions in iOS is `when in use`.\n\nFor more details about what you can do with each permission, see:  \nhttps://developer.apple.com/documentation/corelocation/choosing_the_authorization_level_for_location_services\n\nPermission must be declared in `ios/Runner/Info.plist`:\n\n```xml\n\u003cdict\u003e\n  \u003c!-- When in use --\u003e\n  \u003ckey\u003eNSLocationWhenInUseUsageDescription\u003c/key\u003e\n  \u003cstring\u003eReason why app needs location\u003c/string\u003e\n  \u003c!-- Always --\u003e\n  \u003c!-- for iOS 11 + --\u003e\n  \u003ckey\u003eNSLocationAlwaysAndWhenInUseUsageDescription\u003c/key\u003e\n  \u003cstring\u003eReason why app needs location\u003c/string\u003e\n  \u003c!-- for iOS 9/10 --\u003e\n  \u003ckey\u003eNSLocationAlwaysUsageDescription\u003c/key\u003e\n  \u003cstring\u003eReason why app needs location\u003c/string\u003e\n  \u003c!-- Bluetooth Privacy --\u003e\n  \u003c!-- for iOS 13 + --\u003e\n  \u003ckey\u003eNSBluetoothAlwaysUsageDescription\u003c/key\u003e\n  \u003cstring\u003eReason why app needs bluetooth\u003c/string\u003e\n\u003c/dict\u003e\n```\n\n## iOS Troubleshooting\n\n* Example code works properly only on **physical device** (bluetooth on simulator is disabled)\n* How to deploy flutter app on iOS device [Instruction](https://flutter.dev/docs/get-started/install/macos)\n* If example code don't works on device (beacons not appear), please make sure that you have enabled \u003cbr/\u003e Location and Bluetooth (Settings -\u003e Flutter Beacon) \n\n## How-to\n\nRanging APIs are designed as reactive streams.  \n\n* The first subscription to the stream will start the ranging\n\n### Initializing Library\n\n```dart\ntry {\n  // if you want to manage manual checking about the required permissions\n  await flutterBeacon.initializeScanning;\n  \n  // or if you want to include automatic checking permission\n  await flutterBeacon.initializeAndCheckScanning;\n} on PlatformException catch(e) {\n  // library failed to initialize, check code and message\n}\n```\n\n### Ranging beacons\n\n```dart\nfinal regions = \u003cRegion\u003e[];\n\nif (Platform.isIOS) {\n  // iOS platform, at least set identifier and proximityUUID for region scanning\n  regions.add(Region(\n      identifier: 'Apple Airlocate',\n      proximityUUID: 'E2C56DB5-DFFB-48D2-B060-D0F5A71096E0'));\n} else {\n  // android platform, it can ranging out of beacon that filter all of Proximity UUID\n  regions.add(Region(identifier: 'com.beacon'));\n}\n\n// to start ranging beacons\n_streamRanging = flutterBeacon.ranging(regions).listen((RangingResult result) {\n  // result contains a region and list of beacons found\n  // list can be empty if no matching beacons were found in range\n});\n\n// to stop ranging beacons\n_streamRanging.cancel();\n```\n\n### Monitoring beacons\n\n```dart\nfinal regions = \u003cRegion\u003e[];\n\nif (Platform.isIOS) {\n  // iOS platform, at least set identifier and proximityUUID for region scanning\n  regions.add(Region(\n      identifier: 'Apple Airlocate',\n      proximityUUID: 'E2C56DB5-DFFB-48D2-B060-D0F5A71096E0'));\n} else {\n  // Android platform, it can ranging out of beacon that filter all of Proximity UUID\n  regions.add(Region(identifier: 'com.beacon'));\n}\n\n// to start monitoring beacons\n_streamMonitoring = flutterBeacon.monitoring(regions).listen((MonitoringResult result) {\n  // result contains a region, event type and event state\n});\n\n// to stop monitoring beacons\n_streamMonitoring.cancel();\n```\n\n## Under the hood\n\n* iOS uses native Framework [CoreLocation](https://developer.apple.com/documentation/corelocation/)\n* Android uses the [Android-Beacon-Library](https://github.com/AltBeacon/android-beacon-library) ([Apache License 2.0](https://github.com/AltBeacon/android-beacon-library/blob/master/LICENSE))  \n\n# Author\n\nFlutter Beacon plugin is developed by Eyro Labs. You can contact me at \u003cmaulana@cubeacon.com\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falann-maulana%2Fflutter_beacon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falann-maulana%2Fflutter_beacon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falann-maulana%2Fflutter_beacon/lists"}