File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 22
33import deviceInfo from 'react-native-device-info'
44import networkInfo from 'react-native-network-info'
5+ import { Platform } from 'react-native'
56import pkg from '../../../package.json'
67
78export const getIpAddress = ( ) : Promise < ?string > =>
@@ -13,9 +14,18 @@ export const getIpAddress = (): Promise<?string> =>
1314 }
1415 } )
1516
16- export const getPosition = ( ) : Promise < Object > =>
17+ export const getPosition = ( args : any = { } ) : Promise < Object > =>
1718 new Promise ( ( resolve , reject ) => {
18- navigator . geolocation . getCurrentPosition ( resolve , reject )
19+ if ( Platform . OS === 'ios' ) {
20+ navigator . geolocation . getCurrentPosition ( resolve , reject , {
21+ ...args ,
22+ enableHighAccuracy : true ,
23+ maximumAge : 1000 /* ms */ ,
24+ timeout : 5000 /* ms */ ,
25+ } )
26+ } else {
27+ navigator . geolocation . getCurrentPosition ( resolve , reject )
28+ }
1929 } )
2030
2131export const collectData = async ( ) => ( {
You can’t perform that action at this time.
0 commit comments