capacitor-background-geolocation
capacitor-background-geolocation copied to clipboard
TSAuthorization Causing Crash on Android device
Your Environment
- Plugin version: 6.0.3
- Platform: Android
- Device OS version:
- Device manufacturer / model: samsung a51 (Galaxy A51)
- Capacitor info (
npx cap doctor)
Latest Dependencies:
@capacitor/cli: 6.1.1
@capacitor/core: 6.1.1
@capacitor/android: 6.1.1
@capacitor/ios: 6.1.1
Installed Dependencies:
@capacitor/cli: 6.1.0
@capacitor/core: 6.1.0
@capacitor/android: 6.1.0
@capacitor/ios: 6.1.0
[success] iOS looking great! 👌
[success] Android looking great! 👌
- Plugin config provided to
#ready:
// Geolocation Config
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
// Activity Recognition
stopTimeout: 5,
// IOS
activityType: BackgroundGeolocation.ACTIVITY_TYPE_AUTOMOTIVE_NAVIGATION,
// Application config
debug: false, // <-- enable this hear sounds for background-geolocation life-cycle.
logLevel: process.env.ENV === 'development' ? BackgroundGeolocation.LOG_LEVEL_VERBOSE : BackgroundGeolocation.LOG_LEVEL_OFF,
stopOnTerminate: false, // <-- Allow the background-service to continue tracking when user closes the app.
startOnBoot: true, // <-- Auto start tracking when device is powered-up.
url: `${process.env.API_BASE_URL}/api/v1/data`,
// ios
// https://transistorsoft.github.io/capacitor-background-geolocation/interfaces/config.html#1--locationauthorizationrequest-39always39
locationAuthorizationRequest: 'Always',
// [Android] backgroundPermissionRationale for Always permission.
backgroundPermissionRationale: {
title: `...`,
message: `...`,
positiveAction: `...`,
negativeAction: `...`
},
// ios
// https://transistorsoft.github.io/capacitor-background-geolocation/interfaces/config.html#locationauthorizationalert
locationAuthorizationAlert: {
titleWhenNotEnabled: "...",
titleWhenOff: "...",
instructions: "...",
cancelButton: "...",
settingsButton: "..."
},
authorization: { // <-- JWT authorization for tracker.transistorsoft.com
strategy: 'jwt',
accessToken: tokens.access,
refreshToken: tokens.refresh,
refreshUrl: `${process.env.API_BASE_URL}/api/v1/refresh`,
refreshPayload: {
refresh: '{refreshToken}'
},
expires: tokens.expires
},
distanceFilter: 15, // meters
elasticityMultiplier: 1.5,
useSignificantChangesOnly: false, // Default: false. Defaults to false. Set true in order to disable constant background-tracking. A location will be recorded only several times / hour.
batchSync: true,
maxBatchSize: 25,
maxDaysToPersist: 100, // Default: 1. Maximum number of days to store a geolocation in plugin's SQLite database.
autoSync: true
Expected Behavior
Not sure
Actual Behavior
App is in production and available on the PlayStore. No issues until now. Crash report from 1 user. Playstore info includes this:
Maybe you have seen it before?
java.lang.NumberFormatException
Exception java.lang.NumberFormatException:
at java.lang.Long.parseLong (Long.java:751)
at java.lang.Long.valueOf (Long.java:1203)
at com.transistorsoft.locationmanager.config.TSAuthorization.a
at com.transistorsoft.locationmanager.config.TSAuthorization.a
at com.transistorsoft.locationmanager.config.TSAuthorization.a
at com.transistorsoft.locationmanager.config.TSAuthorization.a
at com.transistorsoft.locationmanager.config.TSAuthorization$a.onResponse
at okhttp3.RealCall$AsyncCall.execute (RealCall.java:203)
at okhttp3.internal.NamedRunnable.run (NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
at java.lang.Thread.run (Thread.java:1012)
Steps to Reproduce
- None atm
Context
Debug logs
Logs
PASTE_YOUR_LOGS_HERE