amplitude applicationWillTerminate not working

  • 20 April 2022
  • 2 replies
  • 217 views

Hello,

 

I want to receive an event when the user forcefully shuts down the app.

 

But, The code I wrote doesn't work.

Isn't there a good way?

 

code : 

    func applicationWillTerminate(_ application: UIApplication) {

        print("applicationWillTerminate")

        AmplitudeHelper.shared.sendEvent(eventString: "app_exit")

}


2 replies

Userlevel 6
Badge +8

Hi @hmbaa ,

 

Thanks for writing in! Which SDK are you using to send your data to Amplitude? We have developer docs here that can provide help with implementing your SDK, depending which one you are using. 

 

I am not aware of any SDK that has 

        AmplitudeHelper.shared.sendEvent(eventString: "app_exit")

Can you elaborate on what you are using to send the events? Thank you!

Userlevel 6
Badge +9

Hi @hmbaa, I hope all is well 😃 I wanted to follow up here. Were you able to make progress? Please keep us posted! 

Reply