Call status change web-service when my App is deleted

后端 未结 3 1923
囚心锁ツ
囚心锁ツ 2021-01-25 03:22

In my application , i works with web-services and when user log in into my app my app is sending a request with status 1 means loged in and when on log out button click sending

3条回答
  •  独厮守ぢ
    2021-01-25 03:56

    You can't do this from within the app. You would want to do something like have a periodic task which runs on the backend, checking the last activity date of logged in users and setting them to 'not available' after some configured period of inactivity. This will probably require some changes to the backend to record last activity date and a change to the app so that while it's open it sends a periodic 'heartbeat' to the backend. You probably want to make the timeout quite big (say 15 minutes, big enough to not have a large impact on performance).

提交回复
热议问题