Questions tagged [applicationwillterminate]

16 questions
8
votes
3 answers

Can I make an api call when the user terminates the app?

I need to make an API call when the user terminates the app (force close). The straight forward implementation I did is as below. In the app delegate, I added the following code. func applicationWillTerminate(_ application: UIApplication) { …
Sujal
  • 1,447
  • 19
  • 34
2
votes
0 answers

applicationWillTerminate doesn't executeFirebase code

This is the code I have in my AppDelegate.swift func applicationWillTerminate(_ application: UIApplication) { FirebaseEventHandler.Instance.endSessionDataSave() print("test3") } This is the code I have in…
1
vote
1 answer

How to Call an API in applicationWillTerminate( ) and get some time for response from the server

Sorry for duplication of question, after long research on the issue that "how to Call an Api in applicationWillTerminate()" but found nothing. There was two solution but some how the are not working for me. solution Found: Can I make an api call…
1
vote
0 answers

Swift, IOS, Detect power button pressed 3 times

I want to do something like getting an event when a user has pressed the power button 3 times within 5 or 10 seconds. Think of this like an SOS / emergency call. If the user pressed 3 times power button then I want to trigger a sound or alarm from…
AtulParmar
  • 4,358
  • 1
  • 24
  • 45
1
vote
2 answers

Firebase: How to clear specific data from firebase when user kill app?

I have app which uses firebase for database and I want to clear specific user field called current_venue when user kill the app and for that I am using AppDelegate method applicationWillTerminate and it's actually calling when I kill the app but not…
0
votes
0 answers

How to perform critical operation on App termination (iOS: WillTeminate, Android:OnDestroy)

I'm working on a Xamarin Forms app that communicates with a hardware device over BLE. If the app user decides to terminate the app by swiping up, I would like to notify the hardware device that the communication channel should be closed. The issue…
0
votes
1 answer

Remove value from array when app terminates Swift Firebase

I have a Firestore Array that has typing users (as IDs) in it. My goal is to remove the current User from that chat when the app terminates. I have read this thread where Frank van Puffelen said that you can remove values on disconnect by using this…
0
votes
1 answer

Why does clicking the close button call `applicationWillTerminate` after `applicationDidEnterBackground` while clicking the minimize button doesn't?

I create a new empty project in Unity and build it on iOS platform and run it on Mac Catalyst. However, I want to figure out the difference between close and minimize. With the help of log, they both called applicationWillResignActive and…
0
votes
1 answer

Find out which view the application was terminated on in applicationWillTerminate()

So suppose I have multiple screens on in my app: View1, View2 etc. If the user is on a certain screen, say View3, and the application terminates because the user quit the app or such, I know applicationWillTerminate(_ application: UIApplication)…
0
votes
1 answer

Why does this supposedly infinite loop program terminate?

I was talking to my friend about these two pieces of code. He said the python one terminates, the C++ one doesn't. Python: arr = [1, 2, 3] for i in range(len(arr)): arr.append(i) print("done") C++: #include #include using…
0
votes
1 answer

Time when the application is terminated

I want to know the current time when the app is being terminated. Using this time, I want to do some calculation and store. How can I do this?
Suhas G
  • 45
  • 5
0
votes
2 answers

Emit socket event in applicationWillTerminate

I am trying to emit a socket event in applicationWillTerminate in AppDelegate. I have used socket.io. I believe I am able to successfully emit the event. Following are the logs I get in the console : 2018-10-08 20:29:45.663856+0530…
0
votes
1 answer

iOS Application will terminate does not work in background

I am trying to set a user default when my application is killed in the background, this code does not work unless the application is open then you background kill it, if the application is closed it does not work. Is there any way around this? I…
0
votes
1 answer

Reasons why iOS will terminate an app

We have a GPS tracking type iOS app which runs in the background. We are seeing infrequent cases where the app appears to be getting terminated with the applicationWillTerminate method being called while the tracking process is taking place. We have…
Spook
  • 1
  • 1
0
votes
0 answers

Deleting Parse Objects when App Terminates

I am using parse to store some objects in my app. When the app terminates I want to delete the objects created with a certain ID. I used the applicationWillTerminate method to post a NSNotification which triggers this method: public func…
cvrattos
  • 51
  • 1
  • 4
1
2