Skip to content
/ iScanner Public

A simple IOS iBeacon scanner and advertisement application

Notifications You must be signed in to change notification settings

Hemki/iScanner

Repository files navigation

iScanner

Description: A simple iBeacon scanner and advertisement app.

Overview

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.

πŸͺ„ Features

  • 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.

πŸ”§ Architecture

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.
    • 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.
  • ios/: Compiled IOS code using npx cap add ios. Can be opened and run in XCode.

πŸ’» Local Installation

Follow these steps to set up and run the application:

  1. Install Node.js and npm if you haven't already. I recommend using nvm for Node.js installation.

  2. Install Ionic CLI globally:

npm install -g @ionic/cli
  1. Clone the repository and navigate to the project folder:
git clone <repository-url>
cd project-folder
  1. Install the project dependencies:
npm install
  1. 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.

  1. To run the app on a physical device or simulator:

For iOS:

ionic cap run ios

Compatibility

  • Tested on an iPhone 12 using IOS 16.

Resources