Download the PHP package projectmata/mobile-geolocation without Composer
On this page you can find all versions of the php package projectmata/mobile-geolocation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download projectmata/mobile-geolocation
More information about projectmata/mobile-geolocation
Files in projectmata/mobile-geolocation
Package mobile-geolocation
Short Description Custom geolocation plugin for NativePHP Mobile
License MIT
Informations about the package mobile-geolocation
Projectmata Mobile Geolocation
Geolocation plugin for NativePHP Mobile. Reads the device's current position on Android and iOS with a single call.
Requirements
- PHP
^8.1 - Laravel
^11.0or^12.0/^13.0 nativephp/mobile- Android:
min_version 33, depends oncom.google.android.gms:play-services-location:21.3.0 - iOS:
min_version 18.2
Installation
Laravel auto-discovery registers the service provider and facade automatically.
Rebuild the mobile app so NativePHP wires up the native plugin and 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 —
NSLocationWhenInUseUsageDescriptionis set to "This app uses your location to show your current position." Override it in your app'sinfo_plistconfig if you want different copy.
Always call requestPermission() before requesting a position, and handle the case where the user denies.
Usage
PHP (Laravel)
JavaScript (in-app)
The plugin registers itself on window.NativePHP.Geolocation:
Or as a bundled import:
Bridge methods
| Method | Params | Returns |
|---|---|---|
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
MIT