BadElf / gps-sdk

The official SDK for developers to use Bad Elf GPS accessories on iOS, Android, and Windows devices.
BSD 3-Clause "New" or "Revised" License
31 stars 13 forks source link

Stops sending locations when app goes active after being in background #10

Closed duanepfeiffer closed 5 months ago

duanepfeiffer commented 5 months ago

New Issue Checklist

Issue Description

Unable to re-start data feed after app goes into background. Accessory stays connected via bluetooth.

INSERT CONSOLE OUTPUT HERE

ENVIRONMENT

XCode 15.3, Esri Native Runtime SDK 200.3.0 Using LocationDisplay with NMEALocationDataSource

Bad Elf Model:

BE-GPS-2500 (flex mini)

Firmware Version:

1.0.28.1255

Platform:

iOS 17.4.1

Protocol String:

com.bad-elf.gps
brhackle commented 5 months ago

Hi Duane, thanks for reporting this. Looks like you're running the latest firmware, so that's good.

Are you able to use the Bad Elf Flex app to see/configure your Flex Mini? Are you seeing similar behavior with Field Maps and/or Survey123? Is the behavior different if you force-kill and restart your app, compared to backgrounding/foregrounding it? Is your app configured for background use of location services and/or EAAccessory usage in your Info.plist?

Thanks, Brett

duanepfeiffer commented 5 months ago

Are you able to use the Bad Elf Flex app to see/configure your Flex Mini?
I can now, I was using the wrong app

Are you seeing similar behavior with Field Maps and/or Survey123? No

Is the behavior different if you force-kill and restart your app, compared to backgrounding/foregrounding it? Yes, if I kill and re-start the app everything starts working again.

Is your app configured for background use of location services and/or EAAccessory usage in your Info.plist? No, I'm struggling with this. I added the [NSLocationAlwaysAndWhenInUseUsageDescription] key and use locationManager to request always authorization, but still getting the same results.

brhackle commented 5 months ago

OK, that's helpful. This seems to be isolated to the Esri Native Runtime SDK, so it might not be anything you (or we) can fix, and may need to be resolved by Esri. That being said, I always assume the problem is on our side until I can prove otherwise.

Does Esri provide a working sample that uses the same runtime APIs? If so, it would be good to confirm you see the same behavior using that.

Any chance you can share a TestFlight build with us? I can sniff what's going on under the covers. Please send the invite to ios@bad-elf.com .

duanepfeiffer commented 5 months ago

Thanks for your help! I have it working now. I believe the fix was to ask for always authorization of location.