Getting location with app closed - SwiftUI - swiftui

I'm making an app that updates the user's location from time to time, and I need to know if it's possible to keep getting the location and sending it to the API even if the user closes the app (really closes, not just switch to other page). I'm searching for this answer for a long time now, can someone help me?

Related

Django - Accessing the same view with complex lengthy algorithm by several users in the same time

I am trying to implement an anonymous chat web application in Django. Right now I am on the stage where I need to connect users with each other based on their preferences, location etc.
So I have a view find_room(request), where I am executing lengthy algorithm which runs for a few seconds, trying to find the closest user who is also searching for other users using the same view.
So my problem is that when one user is calling the find_room view and then the other user calling the same view, then the second user should wait until first users's call is ended.
So basically I need this view to be executed as a separate thread, so that several users can call this view and use this searching algorithm in the same time. Is there any functionality inside django that can help me? Or are there any other technologies I should use? (I heard about celery, but not sure if this is right thing for my purposes).
Sorry if the question is confusing, and thanks for the answers!

How i save and show existing progress status using flask socketio if browser is closed(session)

Requirement :-
working on a project with flask.
flask socketIo ...and i have almost completed the project.
Now i want to implement something which is very common on web development.
Right now i can show the status of background tasks in the UI, and events are getting send to specfic (request.sid ). Now if the user accidentally close his browser and and returns to the same page, for obvious reason he won't see anything ( which was happening in the existing session) but the initial page
I want to a way if the user again comes to the page, it should be redirected to the current status page.
Am trying to achieve something exactly like any cloud based solutions For example if i create an Ec2 instance from console and close it. Upon reopening it will still show the existing operations with current status ( running,pending ) etc..
How can achieve that ?
if the user accidentally close his browser and and returns to the same page, for obvious reason he won't see anything
This isn't really obvious. If your user is logged in to your application then you know them, and presumably you also know what background task each user has pending. When the user returns to the page and logs in again, you should be able to find the state of any background tasks associated with the user.
The only situation in which you would not be able to do this is if you don't require your users to authenticate, in which case when the user comes to your page the second time you have no way to know it is the same user that closed the page before. The fix for this problem is to use authentication, so that your users are always known to the server.

Automatically log out from application when all tabs are closed in browser

I was trying to do automatically logout when all tabs of application are closed.Please let me know if anyone have idea to solve my problem.
Actually I was trying to check duplicate login till session expired.
I successfully done coding to check duplicate login but it failed when I closed tab and re-login with same credential.It shows me message of duplicate login which I have implemented for other machin.
Hence I was looking for solution that once all tabs of application has closed then it should clear session of that user without waiting session idle time to expire.So that immediate login after all tabs get closed would be allowed to same user.
First of all APEX is a stateless system.
Once a page is rendered, it no longer has connection to the database. The DB does not know the difference between you login and then closing the tab or you log in and do noting on that page.
The only two javascript events that detects that you want to close the tab are onunload & onbeforeunload. The problem is that those events are also fired when you leave a site over a link or over your browsers back button. So they are not very helpful in letting the DB know you have closed the tab.

non-volunteer logout when linking between server and client django apps

I am building an app client and another app server (with mini flash games). I need to be logged on the client side to get a button which able an html page with an iFrame which in its turns ask to download the game inside it. so far so good.
On the server side the request from the client will need to check if the user exists, if it does it start to sending the game.
Well the game starts to be sent but stops and the client side is automatically logged out...
I breakpointed the logout method (# init.py) but it does get there... Anyone did already get the same problem.
I am newbie on Django and maybe this is a know problem but I didn't find anything like so far..
Thanks!

Windows Phone app crashes when navigating back from a task

Some pages in my app allow users to click a hyperlink to launch the external browser via a WebBrowserHelper.
I'm carefully saving the app state in OnNavigatedFrom and restoring it in OnNavigatedTo, but when the user navigates back from the web browser into my app, the app hangs, then crashes.
I've carefully followed the great blog post on the Windows Team Blog, but can also reproduce the bug using the provided code there (just add a WebBrowserTask to one of the button click events on the DetailsPage; or in fact a send SMS task).
Can anyone else confirm this bug, or perhaps point out something special that needs to be done to overcome it?
Whoops! Yes it turns out in most cases you just need to resume the debugger to have the app come back to life.
However in my case there is also a bug in my own code. As usual.