Skip to content

[Bug]: setting activity.triggerActivities results in TSActivityConfig error #2590

@lylejantzi3rd

Description

@lylejantzi3rd

Required Reading

  • Confirmed

Plugin Version

5.0.5

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

iPhone 16 Pro Max

Device operating-systems(s)

iOS 26.4.2

React Native / Expo version

0.79.6, Expo 53

What happened?

When I set this in my config:

    BackgroundGeolocation.ready({
      ...
      activity: {
        triggerActivities: ["in_vehicle"],
      },
      ...
    })

I get this error in the logs:

2026-05-19 21:48:21.925 ⚠️-[TSConfigModuleBase setValue:forProperty:] TSActivityConfig: Could not set 'triggerActivities': -[__NSSingleObjectArrayI length]: unrecognized selector sent to instance 0x142801fd0

What I'm attempting to do is restrict what movement will reset the stop-timeout counter. It resets constantly and will never let the app go back to stationary mode.

Plugin Code and/or Config

BackgroundGeolocation.ready({
      geolocation: {
        locationAuthorizationRequest: "Always",
        desiredAccuracy: BackgroundGeolocation.DesiredAccuracy.High,
        distanceFilter: Platform.OS === "android" ? 0 : undefined,
        locationUpdateInterval: Platform.OS === "android" ? 10 * 1000 : undefined,
        fastestLocationUpdateInterval: Platform.OS === "android" ? 5 * 1000 : undefined,
        allowIdenticalLocations: Platform.OS === "android" ? false : undefined,
        activityType: Platform.OS === "ios" ? BackgroundGeolocation.ActivityType.AutomotiveNavigation : undefined,
        pausesLocationUpdatesAutomatically: Platform.OS === "ios" ? false : undefined,
      },
      activity: {
        disableStopDetection: false, // Let RNBG handle stop detection
        triggerActivities: ["in_vehicle"],
      },
      app: {
        stopOnTerminate: false,
        startOnBoot: true,
        heartbeatInterval: 5 * 60,

        ...(Platform.OS === "android"
          ? {
              enableHeadless: true,
              foregroundService: true,
              notification: {
                title: "Mileage Quest",
                text: "Tracking your mileage in the background",
                channelName: "Mileage Tracking",
                priority: BackgroundGeolocation.NotificationPriority.Low,
              },
              backgroundPermissionRationale: {
                title:
                  "Allow Mileage Quest to access your location in the background?",
                message:
                  "Mileage Quest needs background access to automatically detect and log your trips for mileage tracking, even when the app is closed or not in use.",
                positiveAction: "Change to {backgroundPermissionOptionLabel}",
                negativeAction: "Cancel",
              },
            }
          : {}),
        ...(Platform.OS === "ios"
        ? {
          preventSuspend: true,
        } : {}),
      },
      logger: {
        debug: true,
        logLevel: BackgroundGeolocation.LogLevel.Verbose,
      },
      http: {
        autoSync: false,
      },
      persistence: {
        maxDaysToPersist: 7,
      },
    })

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions