Open mohankyro22 opened 1 month ago
there is delay in getting the current location when I added the License key to the Android App.
It can only be a coincidence. Adding the license key cannot possibly affect the time retrieving a location.
debug: true
. $ adb logcat *:S TSLocationManager:V
.Will check and update.
Hey @christocracy,
I got a question.
We use 3 different env's for our RN application. When I add the License key to AndroidManifest main file.
The key validation failure message is not been shown on dev and prod but showing up on the stage.
Is there anything on it ?
Show me your android/app/build.gradle.
The plugin allows a finite number of suffixes to unlock the plugin for other variants:
.dev
/ .development
.staging
.qa
.uat
.test
we use as .stage.
Doesn't the plugin allow that ?
Doesn't the plugin allow that ?
No. The only known suffixes are listed above. The plugin is not aware of the suffix .stage
. Rename yours to .staging
and it will work.
Ok thanks.
For now we are only using getCurrentPosition. Is the above alert will mandatorily show. Is there a way to disable this.
We aren't making use of background location fetching as of now.
See API docs Config.disableMotionActivityUpdates
.
Ok thanks.
LOG_LEVEL_VERBOSE
Do we have to use this in the config ? Can this be removed ?
LOG_LEVEL_VERBOSE
This is for developer debugging and testing only. Released app should have LOG_LEVEL_NONE
Ok thanks
If we disable using Config.disableMotionActivityUpdates as true. We need not mention NSMotionUsageDescription in the info.plist ?
we are getting an app rejection with following message:
ITMS-90683: Missing purpose string in Info.plist.
Your app’s code references one or more APIs that access sensitive user
data, or the app has one or more entitlements that permit such access.
The Info.plist file for the "{app-bundle-path}" bundle should contain a
NSLocationWhenInUseUsageDescription key with a user-facing purpose string
explaining clearly and completely why your app needs the data.
If you’re using external libraries or SDKs, they may reference APIs that
require a purposeful string. While your app might not use these APIs, a
purpose string is still required. For details, visit:
https://developer.apple.com/documentation/uikit/protecting_the_user_s_privacy/requesting_access_to_protected_resources.
We are getting like this when app is submitted for play store.
As per the your docs on Android Manifest file we have to add the License key alone right ?
But on this https://github.com/transistorsoft/react-native-background-geolocation/issues/1149#issuecomment-726295227
I could see some of ACCESS_BACKGROUND_LOCATION permission and all.
We are only using current position request as of now.
@christocracy will be happy to hear from you asap.
See my blog about this. Pay particular attention to the final paragraph, showing you how to manually remove a requested permission.
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" tools:node="remove" />
So do we have to add this to AndroidManifest file ?
So do we have to add this to AndroidManifest file ?
That is exactly what is says, no?
We are seeing this on the Play store submission.
Do we have to set,
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
or
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
@christocracy ?
We are seeing this on the Play store submission.
Do we have to set,
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
or
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
@christocracy ?
Any update on this @christocracy
@christocracy
When the application target SDK was set, 34 faced this. I tried two approaches . Because android newly announced Required the foreground service types
tools:node="remove"
option
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" tools:node="remove" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" tools:node="remove" />
33
I am using this library to get the current location only with the following config
await BackgroundGeolocation.getCurrentPosition(
{
persist: true,
samples: 3,
timeout: 30,
maximumAge: 5000,
extras: {
getCurrentPosition: true,
},
},
(location) => {
const { longitude, latitude, altitude, accuracy } = location.coords
const locationDetails = {
longitude,
latitude,
altitude,
accuracy,
timestamp: new Date(),
}
if (setFieldValue && fieldName) {
setFieldValue(fieldName, JSON.stringify(locationDetails))
setIsLoading(false)
}
},
(failure) => {
if (setFieldValue && fieldName) {
setFieldValue(
fieldName,
JSON.stringify({
longitude: '',
latitude: '',
altitude: '',
accuracy: '',
timestamp: '',
}),
)
}
console.log('🚀 ~ fetchCurrentLocation ~ failure:', failure)
},
)
I followed the first approach (removing the permission from the manifest). Is that the correct way to approach ?
Do we have to execute
useEffect(() => {
BackgroundGeolocation.ready({
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
locationAuthorizationRequest: 'WhenInUse',
disableMotionActivityUpdates: true,
})
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
this on all the screens wherever the location is being fetched ? @christocracy ?
This issue is stale because it has been open for 30 days with no activity.
Location getting delayed when I add License key to Android app
Is there any way I can overcome the above.
Your Environment
react-native -v
): 0.70.6Plugin config
Expected Behavior
To get location quicker when license key is added.
Actual Behavior
Significantly there is delay in getting the current location when I added the License key to the Android App. Before adding the License key it was about 2 or 3 seconds to get the currentLocation but after adding License key it is taking about 10 seconds.
Debug logs
Logs
``` PASTE_YOUR_LOGS_HERE ```