mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Updated docs for next
This commit is contained in:
@@ -17,7 +17,10 @@ enabled by default when you create a project with <code>react-native init</code>
|
||||
'NSLocationAlwaysUsageDescription' key in Info.plist and add location as
|
||||
a background mode in the 'Capabilities' tab in Xcode.</p><h4><a class="anchor" name="android"></a>Android <a class="hash-link" href="docs/geolocation.html#android">#</a></h4><p>To request access to location, you need to add the following line to your
|
||||
app's <code>AndroidManifest.xml</code>:</p><p><code><uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /></code></p><p>Android API >= 18 Positions will also contain a <code>mocked</code> boolean to indicate if position
|
||||
was created from a mock provider.</p></div><span><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="docs/geolocation.html#methods">#</a></h3><div class="props"><div class="prop"><h4 class="methodTitle"><a class="anchor" name="getcurrentposition"></a><span class="methodType">static </span>getCurrentPosition<span class="methodType">(geo_success, geo_error?, geo_options?)</span> <a class="hash-link" href="docs/geolocation.html#getcurrentposition">#</a></h4><div><p>Invokes the success callback once with the latest location info. Supported
|
||||
was created from a mock provider.</p></div><span><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="docs/geolocation.html#methods">#</a></h3><div class="props"><div class="prop"><h4 class="methodTitle"><a class="anchor" name="requestauthorization"></a><span class="methodType">static </span>requestAuthorization<span class="methodType">()</span> <a class="hash-link" href="docs/geolocation.html#requestauthorization">#</a></h4><div><p>Request suitable Location permission based on the key configured on pList.
|
||||
If NSLocationAlwaysUsageDescription is set, it will request Always authorization,
|
||||
although if NSLocationWhenInUseUsageDescription is set, it will request InUse
|
||||
authorization.</p></div></div><div class="prop"><h4 class="methodTitle"><a class="anchor" name="getcurrentposition"></a><span class="methodType">static </span>getCurrentPosition<span class="methodType">(geo_success, geo_error?, geo_options?)</span> <a class="hash-link" href="docs/geolocation.html#getcurrentposition">#</a></h4><div><p>Invokes the success callback once with the latest location info. Supported
|
||||
options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool)
|
||||
On Android, if the location is cached this can return almost immediately,
|
||||
or it will request an update which might take a while.</p></div></div><div class="prop"><h4 class="methodTitle"><a class="anchor" name="watchposition"></a><span class="methodType">static </span>watchPosition<span class="methodType">(success, error?, options?)</span> <a class="hash-link" href="docs/geolocation.html#watchposition">#</a></h4><div><p>Invokes the success callback whenever the location changes. Supported
|
||||
|
||||
Reference in New Issue
Block a user