PHPackages                             projectmata/mobile-geolocation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. projectmata/mobile-geolocation

ActiveNativephp-plugin[Utility &amp; Helpers](/categories/utility)

projectmata/mobile-geolocation
==============================

Custom geolocation plugin for NativePHP Mobile

v1.0.0(1mo ago)04↓100%MITKotlinPHP ^8.1

Since Apr 25Pushed 1mo agoCompare

[ Source](https://github.com/jomarmata24/mobile-geolocation)[ Packagist](https://packagist.org/packages/projectmata/mobile-geolocation)[ RSS](/packages/projectmata-mobile-geolocation/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Projectmata Mobile Geolocation
==============================

[](#projectmata-mobile-geolocation)

[![Latest Version](https://camo.githubusercontent.com/7559c3adbb5b184194d3b7bb3956658ca3e2fd1a09a035fab68f6d9bd1ed60b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726f6a6563746d6174612f6d6f62696c652d67656f6c6f636174696f6e2e737667)](https://packagist.org/packages/projectmata/mobile-geolocation)[![Total Downloads](https://camo.githubusercontent.com/e8c1934fe37ec377e99c0599d02ebfb32b153b62b378dd462793a1a5c70efe8d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70726f6a6563746d6174612f6d6f62696c652d67656f6c6f636174696f6e2e737667)](https://packagist.org/packages/projectmata/mobile-geolocation)[![License](https://camo.githubusercontent.com/04a297f3f9d08bc7b3be739d38a33cb5fe0da095ba69d0d3717978c92a09d955/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70726f6a6563746d6174612f6d6f62696c652d67656f6c6f636174696f6e2e737667)](https://packagist.org/packages/projectmata/mobile-geolocation)

Geolocation plugin for [NativePHP Mobile](https://nativephp.com). Reads the device's current position on Android and iOS with a single call.

Requirements
------------

[](#requirements)

- PHP `^8.1`
- Laravel `^11.0` or `^12.0` / `^13.0`
- `nativephp/mobile`
- Android: `min_version 33`, depends on `com.google.android.gms:play-services-location:21.3.0`
- iOS: `min_version 18.2`

Installation
------------

[](#installation)

```
composer require projectmata/mobile-geolocation
```

Laravel auto-discovery registers the service provider and facade automatically.

Rebuild the mobile app so NativePHP wires up the native plugin and permissions:

```
php artisan native:run android
# or
php artisan native:run ios
```

Permissions
-----------

[](#permissions)

The package declares these for you via its `nativephp.json` manifest — you don't need to add them manually:

- **Android** — `ACCESS_COARSE_LOCATION`, `ACCESS_FINE_LOCATION`
- **iOS** — `NSLocationWhenInUseUsageDescription` is set to *"This app uses your location to show your current position."* Override it in your app's `info_plist` config if you want different copy.

Always call `requestPermission()` before requesting a position, and handle the case where the user denies.

Usage
-----

[](#usage)

### PHP (Laravel)

[](#php-laravel)

```
use Projectmata\MobileGeolocation\Facades\Geolocation;

// Ask the OS for location permission (no-op if already granted)
$perm = Geolocation::requestPermission();

// Then read the position
$pos = Geolocation::getCurrentPosition(highAccuracy: true);

// $pos = ['success' => true, 'latitude' => ..., 'longitude' => ..., 'accuracy' => ...]
```

### JavaScript (in-app)

[](#javascript-in-app)

The plugin registers itself on `window.NativePHP.Geolocation`:

```
await window.NativePHP.Geolocation.RequestPermission();

const pos = await window.NativePHP.Geolocation.GetCurrentPosition({ highAccuracy: true });

if (pos.success) {
    console.log(pos.latitude, pos.longitude, pos.accuracy);
}
```

Or as a bundled import:

```
import Geolocation, { getCurrentPosition } from 'projectmata-mobile-geolocation';
```

Bridge methods
--------------

[](#bridge-methods)

MethodParamsReturns`Geolocation.RequestPermission`—`{ success, granted }``Geolocation.GetCurrentPosition``{ highAccuracy: boolean }``{ success, latitude, longitude, accuracy, timestamp }`The `highAccuracy` flag maps to Fused Location's high-accuracy mode on Android and `kCLLocationAccuracyBest` on iOS.

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance91

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f5495492f5d4cf3c05ca542a5bbf714e889fdad7a60930fdde6eacf5dfe45151?d=identicon)[ramilojomar2001@gmail.com](/maintainers/ramilojomar2001@gmail.com)

---

Top Contributors

[![jomarmata24](https://avatars.githubusercontent.com/u/64277739?v=4)](https://github.com/jomarmata24 "jomarmata24 (2 commits)")

### Embed Badge

![Health badge](/badges/projectmata-mobile-geolocation/health.svg)

```
[![Health](https://phpackages.com/badges/projectmata-mobile-geolocation/health.svg)](https://phpackages.com/packages/projectmata-mobile-geolocation)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
