Video Demo: https://www.youtube.com/watch?v=iki2Dmt9oVE
iScanner is an IOS app that can be used to scan for and advertise as an iBeacon device. iBeacon is a technology developed by Apple that allows mobile devices to detect and interact with beacons placed in the physical environment. The App is split into three tabs:
- Receive: Scan for nearby iBeacons.
- Transmit: Advertise as an iBeacon.
- Settings: Configure scan and advertisement parameters.
- Scanning iBeacon(s): Scan for nearby iBeacons by supplying one or several UUIDs. The information of all nearby iBeacons are displayed in a list, including UUID, major, minor, proximity and RSSI (Received Signal Strength Indicator).
- Advertising iBeacon: Turn your smartphone into an iBeacon. This allows other devices to scan and detect your phone as an iBeacon. You can configure your iBeacon advertisiment parameters in the Settings tab.
The application is built using the Ionic/Angular framework.
- Ionic:
- Ionic CLI : 7.1.1
- Ionic Framework : @ionic/angular 7.2.2
- @angular-devkit/build-angular : 16.1.8
- @angular-devkit/schematics : 16.1.8
- @angular/cli : 16.1.8
- @ionic/angular-toolkit : 9.0.0
- Capacitor:
- Capacitor CLI : 5.2.2
- @capacitor/android : not installed
- @capacitor/core : 5.2.2
- @capacitor/ios : 5.2.2
- System:
- NodeJS : v18.17.0
- npm : 9.6.7
- OS : macOS
βββ src/
| βββ app/
| | βββ services/
| | | βββ iBeacon/
| | | | βββ receive/
| | | | | βββ receive-beacon.service.ts
| | | | | βββ receive-beacon.service.spec.ts
| | | | βββ transmit/
| | | | | βββ transmit-beacon.service.ts
| | | | | βββ transmit-beacon.service.spec.ts
| | | βββ shared/
| | | | βββ defaults/
| | | | | βββ defaultRssiFilter.ts
| | | | | βββ defaultTxParameters.ts
| | | | βββ storage/
| | | | | βββ storage.service.ts
| | | | | βββ storage.service.spec.ts
| | | | βββ types/
| | | | | βββ rssiFilter.ts
| | | | | βββ uuid.ts
| | | | | βββ txParameters.ts
| | βββ pages/
| | | βββ tab1-scan/
| | | | βββ tab1.page.html
| | | | βββ tab1.page.scss
| | | | βββ tab1.page.spec.ts
| | | | βββ tab1.module.ts
| | | | βββ tab1-routing.module.ts
| | | | βββ tab1.page.ts
| | | βββ tab2-transmit/
| | | | βββ tab2.page.html
| | | | βββ tab2.page.scss
| | | | βββ tab2.page.spec.ts
| | | | βββ tab2.module.ts
| | | | βββ tab2-routing.module.ts
| | | | βββ tab2.page.ts
| | | βββ tab3-config/
| | | | βββ tab3.page.html
| | | | βββ tab3.page.scss
| | | | βββ tab3.page.spec.ts
| | | | βββ tab3.module.ts
| | | | βββ tab3-routing.module.ts
| | | | βββ tab3.page.ts
| | | βββ subsites/
| | | | βββ beacon-detail/
| | | | | βββ beacon-detail.page.html
| | | | | βββ beacon-detail.page.scss
| | | | | βββ beacon-detail.page.spec.ts
| | | | | βββ beacon-detail.module.ts
| | | | | βββ beacon-detail-routing.module.ts
| | | | | βββ beacon-detail.page.ts
| | | | βββ configure/
| | | | | βββ missing-config/
| | | | | | βββ explore-container.page.html
| | | | | | βββ explore-container.page.scss
| | | | | | βββ explore-container.page.spec.ts
| | | | | | βββ explore-container.module.ts
| | | | | | βββ explore-container-routing.module.ts
| | | | | | βββ explore-container.page.ts
| | | | | βββ uuids/
| | | | | | βββ uuids.page.html
| | | | | | βββ uuids.page.scss
| | | | | | βββ uuids.page.spec.ts
| | | | | | βββ uuids.module.ts
| | | | | | βββ uuids-routing.module.ts
| | | | | | βββ uuids.page.ts
| | βββ app-routing.module.ts
| | βββ app.component.html
| | βββ app.component.scss
| | βββ app.component.spec.ts
| | βββ app.component.ts
| | βββ app.module.ts
| βββ main.ts
βββ ios/
βββ www/
βββ resources/
βββ package.json
βββ tsconfig.json
βββ ...
The most important files and folders are the following:
- app/
- services/
- iBeacon/
- receive/ -receive-beacon.service.ts: Responsible for ranging Beacons
- transmit/ -receive-beacon.service.ts: Responsible for advertising phone as Beacon
- shared/
- storage/: Responsible for storing advertisingParameters and UUIDs to be scanned.
- iBeacon/
- pages/
- tab1-scan/: HTML, CSS and TS for the first Tab, Receiving.
- tab2-transmit/: HTML, CSS and TS for the second Tab, Transmitting.
- tab3-config/: HTML, CSS and TS for the last Tab, Configuration.
- subsites/
- beacon-detail/: HTML, CSS and TS for a beacon-detail pane.
- configure/
- uuids/: HTML, CSS and TS for adding and deleting UUIDs from the Storage.
- services/
- ios/: Compiled IOS code using npx cap add ios. Can be opened and run in XCode.
Follow these steps to set up and run the application:
-
Install Node.js and npm if you haven't already. I recommend using nvm for Node.js installation.
-
Install Ionic CLI globally:
npm install -g @ionic/cli
- Clone the repository and navigate to the project folder:
git clone <repository-url>
cd project-folder
- Install the project dependencies:
npm install
- To run the app in the browser for development:
ionic serve
Please note that Bluetooth services are not available in a browser but only on a native ios device.
- To run the app on a physical device or simulator:
For iOS:
ionic cap run ios
- Tested on an iPhone 12 using IOS 16.
- Ionic Documentation: https://ionicframework.com/docs
- Cordova iBeacon Plugin: https://github.com/petermetz/cordova-plugin-ibeacon
- Apple iBeacon Guidelines: https://developer.apple.com/ibeacon/