Flucadetena / pedometer_2

BSD 3-Clause "New" or "Revised" License
4 stars 5 forks source link

[Question] [ANDROID/IOS] parallel counter stream #5

Open arashmidos opened 2 months ago

arashmidos commented 2 months ago

Describe the bug I need to have two separate counter streams. But when I create the second one, the other stops updating.

To Reproduce Consider this snippet code:

...
final stream1 = Pedometer().stepCountStreamFrom(from: today);
final subscription1 = stream1.listen( onStepCount1 )..onError( logError1 );
// stream1 works correctly 
...
final stream2 = Pedometer().stepCountStreamFrom(from: specificDate);
final subscription2 = stream2.listen( onStepCount2 )..onError( logError2 );
// now stream1 stops updating.

I'm unsure if it's a bug or if I was doing something wrong. Each stream belongs to a separate screen and has its conditions to start/stop. So I can not take the difference and use one of them. I would greatly appreciate any help.

Platforms & Versions:

Flucadetena commented 2 months ago

Hi @arashmidos I'm not sure the native API supports it.

I'm going to try and see what I can come up with to try and help.

Nevertheless, wouldn't it be easier to just have one stream from the oldest date. Then get the steps between that date and today and get the difference?

Flucadetena commented 3 weeks ago

Hey @arashmidos where you able to do it the way I recommend it?