react-native-geolocation-service icon indicating copy to clipboard operation
react-native-geolocation-service copied to clipboard

gps location service is not working when app is in background state in android

Open lavanyasree-ch opened this issue 1 year ago • 13 comments

Environment

Run npx react-native info in your terminal and copy the results here.

OS: macOS 13.0.1 CPU: (8) arm64 Apple M1 Memory: 81.39 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.0.0 - /opt/homebrew/bin/node Yarn: 1.22.18 - /opt/homebrew/bin/yarn npm: 8.19.2 - /opt/homebrew/bin/npm Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8193401 Xcode: 14.2/14C18 - /usr/bin/xcodebuild Languages: Java: 11.0.14.1 - /usr/bin/javac npmPackages: react: 17.0.2 => 17.0.2 react-native: 0.67.0 => 0.67.0

Platforms

Android

Versions

Please add the used versions/branches

  • Android:12
  • iOS:-
  • react-native-geolocation-service: 5.3.0-beta.2
  • react-native:"0.67.0"

Description

in android gps location service is not working when app goes into background state. but in foreground state it is working fine. and also it's working fine for ios in both background and foreground state.

lavanyasree-ch avatar Dec 21 '22 10:12 lavanyasree-ch

@lavanyasree-ch I need help about this library, can you text me on linkedIn.

https://www.linkedin.com/in/asadmumtaz92

asadmumtaz92 avatar Dec 27 '22 09:12 asadmumtaz92

@lavanyasree-ch i'm also not getting the location when the app is in background in android. Any Solution?

SurajMohanty02 avatar Jan 04 '23 06:01 SurajMohanty02

same. i am also unable to get location when minimising app

ubaidjs avatar Jan 08 '23 14:01 ubaidjs

I hope you are fine.

Now I'am using thies following libraries:

  1. @react-native-get-location (for getting location)
  2. @supersami/rn-foreground-service (for background task)

On Wed, Jan 4, 2023 at 11:07 AM Suraj Mohanty @.***> wrote:

@lavanyasree-ch https://github.com/lavanyasree-ch i'm also not getting the location when the app is in background in android. Any Solution?

— Reply to this email directly, view it on GitHub https://github.com/Agontuk/react-native-geolocation-service/issues/391#issuecomment-1370522012, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKSI6TO2H4IPN5KBAOUQ3IDWQUHTFANCNFSM6AAAAAATFOJKJI . You are receiving this because you commented.Message ID: @.*** com>

asadmumtaz92 avatar Jan 11 '23 12:01 asadmumtaz92

same. i am also unable to get location when minimising app

Now I'am using thies following libraries:

  1. @react-native-get-location (for getting location)
  2. @supersami/rn-foreground-service (for background task)

asadmumtaz92 avatar Jan 11 '23 12:01 asadmumtaz92

@lavanyasree-ch i'm also not getting the location when the app is in background in android. Any Solution?

Now I'am using thies following libraries:

  1. @react-native-get-location (for getting location)
  2. @supersami/rn-foreground-service (for background task)

asadmumtaz92 avatar Jan 11 '23 12:01 asadmumtaz92

Paid package is working in background getting location backgroun-geolocation but we have to call another package for running app in background I am using background-actions.

lavanyasree-ch avatar Jan 11 '23 13:01 lavanyasree-ch

@lavanyasree-ch i'm also not getting the location when the app is in background in android. Any Solution?

Now I'am using thies following libraries:

  1. @react-native-get-location (for getting location)
  2. @supersami/rn-foreground-service (for background task)

Is it working in when mobile phone screen is locked / off?

SurajMohanty02 avatar Jan 12 '23 04:01 SurajMohanty02

There is one issue with background-actions after closing app also it's running in background. After uninstall app only It will stop doing in background.and it showing pop-up our app is accessing location like that

lavanyasree-ch avatar Jan 12 '23 04:01 lavanyasree-ch

@lavanyasree-ch i'm also not getting the location when the app is in background in android. Any Solution?

Now I'am using thies following libraries:

1. @react-native-get-location (for getting location)

2. @supersami/rn-foreground-service (for background task)

@asadmumtaz92 I have the same setup and the same error. Did you solve it?

AlessandroSalvetti avatar Feb 27 '23 17:02 AlessandroSalvetti

I solved it adding android:foregroundServiceType="location" to the supersami service tag into AndroidManifest.xml, like this:

<service android:name="com.supersami.foregroundservice.ForegroundService" android:foregroundServiceType="location"></service>
<service android:name="com.supersami.foregroundservice.ForegroundServiceTask" android:foregroundServiceType="location"></service>

AlessandroSalvetti avatar Feb 28 '23 08:02 AlessandroSalvetti

I'm using react-native-background-timer for get location on background, It working good with IOS but Android seem not, any solution :<

NgVSang avatar Sep 21 '23 04:09 NgVSang

@lavanyasree-ch How did you used both react native background action with paid geolocation package? Can you please tell me?

SurajMohanty02 avatar Dec 05 '23 13:12 SurajMohanty02