Comments (10)
Hi, I think the issue is because when you re-open the app inactive
state is emitted which overwrites the previous value of _appLostFocusTimestamp
. I have raised a fix, can you checkout to this branch and try once. If it works I'll merge the PR and create a new release
from local_session_timeout.
Great! I'll create a new release with this fix
from local_session_timeout.
I solve mine by adding a package called wakelock_plus, In this case we know that the app is still in foreground even the though it's on screen.
e.g.
When app is inactive call the WakeLockPlus.enable();
When app is resumed call the WakeLockPlus.disable()
I hope this finds you helpful.
from local_session_timeout.
Hi @guperini , Android kills background processes for power saving ref.
Thanks for the input @Erchil66 , I'll go through the package and see if same can be used here
from local_session_timeout.
Hi, i've fixed this issue in latest release 3.0.0
. I have removed the timer completely which has risk of getting terminated from OS, instead storing the timestamp when app is pushed to the background and calculating the time difference when app regains focus.
from local_session_timeout.
Hi, In my case when app in minimize (background -> foreground) invalidateSessionForAppLostFocus is work in first time but next time when minimize again it not work. I am not sure is cause from time stamp in status inactive set new time. thank you.
minimize (foreground -> background)
flutter: state AppLifecycleState.inactive
flutter: state AppLifecycleState.hidden
flutter: state AppLifecycleState.paused
open app again (background -> foreground)
flutter: state AppLifecycleState.hidden
flutter: state AppLifecycleState.inactive
flutter: state AppLifecycleState.resumed
from local_session_timeout.
Hi @klaokamol I'll check this
from local_session_timeout.
@klaokamol Its working fine for me, can you check if the same issue is occurring in the example app? You can disable invalidateSessionForUserInactivity
by passing null so that it won't interrupt.
from local_session_timeout.
Thank you for reply, I'm testing by use same code like exmaple: Sample Usage and rollback to old version is work fine.
my invalidateSessionForUserInactivity
duration set to 1 second
test step:
-
run app first minimize app and open app again
(invalidateSessionForAppLostFocus is work in first time andtimeoutEvent == SessionTimeoutState.appFocusTimeout
) -
minimize app (foreground -> background)
flutter: state AppLifecycleState.inactive -> lib stamp time 00:01:30.00
flutter: state AppLifecycleState.hidden
flutter: state AppLifecycleState.paused
- open app again (background -> foreground)
flutter: state AppLifecycleState.hidden
flutter: state AppLifecycleState.inactive -> lib stamp time 00:01:31.00
flutter: state AppLifecycleState.resumed -> check dif time ( 00:01:31.00 and 00:01:30.02) < 1s
difference time in SessionTimeoutManager
function didChangeAppLifecycleState
is always false because it's double stamp time. and sessionConfig.stream.listen((SessionTimeoutState timeoutEvent)
not call back.
from local_session_timeout.
@SankethBK I tested it and it worked. Thanks for your help. 🙇
from local_session_timeout.
Related Issues (20)
- Not getting it to work HOT 18
- timeoutEvent == SessionTimeoutState.userInactivityTimeout HOT 16
- SessionTimeoutState.userInactivityTimeout event keep calling even when user is interact with the app . HOT 2
- setState is being called on a deactivated widget
- suggestion HOT 1
- sessionStateStream.add(SessionState.startListening); causes screen navigation issues HOT 4
- Handle SessionTimeoutManager.sessionConfig change HOT 2
- Irregular Session State Stream behaviour HOT 1
- Session manager times out on auth screen HOT 3
- Need login twice when using easy_localization HOT 5
- Flutter Web: SessionTimeoutState.userInactivityTimeout event keep calling even when user interacts with the app HOT 3
- Timeout event is not firing when duration set to 8 hours and app is in background HOT 10
- sessionStateStream issue with Getx HOT 19
- Warning alert with timer reducing before logout HOT 7
- Does not work a screen that has movement activity HOT 2
- Events are not firing on Samsung S23 Android 14 device HOT 3
- SessionTimeoutState.userInactivityTimeout event keep calling even when user is interact with the app . HOT 3
- ForeGround Timer Not Working Properly HOT 9
- For Single TAPs pointerDown event is not hitting whenever talkback is ON and recordPointerEvent is not calling HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from local_session_timeout.