Skip to content

published expo application is showing me the right mile, Google play store is showing wrong miles  #24856

Closed
@anjali100

Description

@anjali100

Hi All,

React-native-cli: 2.0.1
react-native : 0.57.1

In my React Native application, I am showing miles from the users current location to the destination. I am using geodist for that purpose. Below is my partial code:

`componentDidMount() {
navigator.geolocation.getCurrentPosition(
(position) => {
this.setState({
latitude: position.coords.latitude,
longitude: position.coords.longitude,
error: null,
});
},
(error) => this.setState({ error: error.message }),
{ enableHighAccuracy: true, timeout: 20000, maximumAge: 1000 },
);

var geodist = require('geodist');
var sLat= this.state.latitude;
var sLong = this.state.longitude;

var dist = geodist({lat: sLat, lon: sLong}, {lat: item.LatL, lon: item.Long2}, 'mi') `

I have the following code in my androidManifest file in my android folder:
`manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mobileapps.acrapplication">

<uses-permission android:name="android.Manifest.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application
  android:name=".MainApplication"
  android:label="@string/app_name"
  android:icon="@mipmap/ic_launcher"
  android:allowBackup="false"
  android:theme="@style/AppTheme">
  <activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
    android:windowSoftInputMode="adjustResize">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
  </activity>
  <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>

`

when I publish this app using expo, in expo link, the calculated miles from users current position to destination are shown right on my android phone, but when I publish this app in Google play store then miles are wrong. Do I need too do anything in Google play store or in my code so that Google play store shows the right miles. It seems the current user location in Google play store is wrong.

Any help will be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugRan CommandsOne of our bots successfully processed a command.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions