# jomarmata24/mobile-geolocation architecture

> Architecture diagram of the GitHub repository jomarmata24/mobile-geolocation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jomarmata24/mobile-geolocation
- Repository: https://github.com/jomarmata24/mobile-geolocation

## Overview

This NativePHP Mobile plugin lets an app request location permission and retrieve the device’s current position through either its Laravel facade or JavaScript API. Both entry points invoke named bridge methods; Android and iOS provide native implementations that return permission or position results. The README also documents manifest-declared platform permissions and accuracy options. Native bridge registration details are not present in the sampled source, so wiring between bridge method names and native implementations is documented rather than inferred.

Main entry points: [`src/GeolocationManager.php`](https://github.com/jomarmata24/mobile-geolocation/blob/main/src/GeolocationManager.php) (Geolocation manager), [`resources/android/src/main/java/com/projectmata/mobilegeolocation/GeolocationPlugin.kt`](https://github.com/jomarmata24/mobile-geolocation/blob/main/resources/android/src/main/java/com/projectmata/mobilegeolocation/GeolocationPlugin.kt) (Android plugin), [`resources/ios/Sources/MobileGeolocation/GeolocationPlugin.swift`](https://github.com/jomarmata24/mobile-geolocation/blob/main/resources/ios/Sources/MobileGeolocation/GeolocationPlugin.swift) (iOS plugin), [`nativephp.json`](https://github.com/jomarmata24/mobile-geolocation/blob/main/nativephp.json) (Plugin permissions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_php["Laravel API"]
  node_facade["Geolocation facade<br/>[Geolocation.php]"]
  node_manager["Geolocation manager"]
  node_provider["Service provider"]
end

subgraph group_js["JavaScript API"]
  node_js_api["Geolocation JS API<br/>[index.js]"]
end

subgraph group_native["Native location"]
  node_manifest["Plugin permissions<br/>[nativephp.json]"]
  node_android["Android plugin"]
  node_ios["iOS plugin"]
end

node_laravel_app(("Laravel app"))
node_bridge["NativePHP bridge"]
node_js_app(("In-app JavaScript"))
node_android_os["Android location services"]
node_ios_os["iOS location services"]

node_laravel_app -->|"calls"| node_facade
node_facade -->|"resolves"| node_manager
node_provider -->|"registers"| node_manager
node_manager -->|"invokes methods"| node_bridge
node_js_app -->|"calls"| node_js_api
node_js_api -->|"POSTs calls"| node_bridge
node_bridge -->|"dispatches methods"| node_android
node_bridge -->|"dispatches methods"| node_ios
node_manifest -.->|"declares permissions"| node_android
node_manifest -.->|"declares permissions"| node_ios
node_android -->|"checks permission; reads location"| node_android_os
node_ios -->|"requests permission; reads location"| node_ios_os

click node_facade "https://github.com/jomarmata24/mobile-geolocation/blob/main/src/Facades/Geolocation.php"
click node_manager "https://github.com/jomarmata24/mobile-geolocation/blob/main/src/GeolocationManager.php"
click node_provider "https://github.com/jomarmata24/mobile-geolocation/blob/main/src/MobileGeolocationServiceProvider.php"
click node_js_api "https://github.com/jomarmata24/mobile-geolocation/blob/main/resources/js/index.js"
click node_manifest "https://github.com/jomarmata24/mobile-geolocation/blob/main/nativephp.json"
click node_android "https://github.com/jomarmata24/mobile-geolocation/blob/main/resources/android/src/main/java/com/projectmata/mobilegeolocation/GeolocationPlugin.kt"
click node_ios "https://github.com/jomarmata24/mobile-geolocation/blob/main/resources/ios/Sources/MobileGeolocation/GeolocationPlugin.swift"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_facade,node_manager,node_provider toneBlue
class node_js_api toneAmber
class node_manifest,node_android,node_ios toneMint
class node_laravel_app,node_bridge,node_js_app,node_android_os,node_ios_os toneIndigo
```

## Components

### Laravel API

- [Geolocation facade](https://github.com/jomarmata24/mobile-geolocation/blob/main/src/Facades/Geolocation.php): `src/Facades/Geolocation.php`
- [Geolocation manager](https://github.com/jomarmata24/mobile-geolocation/blob/main/src/GeolocationManager.php): `src/GeolocationManager.php`
- [Service provider](https://github.com/jomarmata24/mobile-geolocation/blob/main/src/MobileGeolocationServiceProvider.php): `src/MobileGeolocationServiceProvider.php`

### JavaScript API

- [Geolocation JS API](https://github.com/jomarmata24/mobile-geolocation/blob/main/resources/js/index.js): `resources/js/index.js`

### Native location

- [Plugin permissions](https://github.com/jomarmata24/mobile-geolocation/blob/main/nativephp.json): `nativephp.json`
- [Android plugin](https://github.com/jomarmata24/mobile-geolocation/blob/main/resources/android/src/main/java/com/projectmata/mobilegeolocation/GeolocationPlugin.kt): `resources/android/src/main/java/com/projectmata/mobilegeolocation/GeolocationPlugin.kt`
- [iOS plugin](https://github.com/jomarmata24/mobile-geolocation/blob/main/resources/ios/Sources/MobileGeolocation/GeolocationPlugin.swift): `resources/ios/Sources/MobileGeolocation/GeolocationPlugin.swift`

### Other components

- **Laravel app**
- **NativePHP bridge**
- **In-app JavaScript**
- **Android location services**
- **iOS location services**

## Connections

- Laravel app → Geolocation facade: calls
- Geolocation facade → Geolocation manager: resolves
- Service provider → Geolocation manager: registers
- Geolocation manager → NativePHP bridge: invokes methods
- In-app JavaScript → Geolocation JS API: calls
- Geolocation JS API → NativePHP bridge: POSTs calls
- NativePHP bridge → Android plugin: dispatches methods
- NativePHP bridge → iOS plugin: dispatches methods
- Plugin permissions → Android plugin: declares permissions
- Plugin permissions → iOS plugin: declares permissions
- Android plugin → Android location services: checks permission; reads location
- iOS plugin → iOS location services: requests permission; reads location
