applicationWillTerminate doesn't executeFirebase code

371 Views Asked by At

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 FirebaseEventHandler.swift

func endSessionDataSave()
    {
        if(guideToGalaxy != 0)
        {
            print("test1")
            eventCatch(eventName: "theAnswerTo", parameterName: "Life_Universe_Everything", parameterValue: 42)
            print("test2")
        }
func eventCatch(eventName: String, parameterName: String, parameterValue: Int)
    {
        Analytics.logEvent(eventName, parameters: [
            parameterName: parameterValue as NSObject
            ])
    }
  • I will get test1, test2, and test3 in my output
  • In following the breakpoints, I can clearly see that the program is walking through all of the code
  • The event will not show up in Firebase though

Any ideas as to why I am not receiving this data in Firebase? I was thinking there might a delay in the sending of information to Firebase, and that the app just terminates too quickly, but I have no way of knowing this...

0

There are 0 best solutions below