Here is a symbolicated file
DigiDeals-2024-07-23-150203_symbolicated.txt
this is the code in AppDelegate didFinishLaunchingWithOptions that calls displayMessages which is where the app seems to crash
Task{
await universal.displayMessages()
}
this is the displayMessages() code with the line it seems to crash at in bold. Again, the alert shows and when OK is selected (only when app is first opened after download otherwise the app just goes to the home screen when OK is selected) the popUpZipCode() (underlined below) runs. The app seems to crash only when the app first runs after download.
func displayMessages() async{
var inf: Information = Information(Message: " ", MsgType: " ")
var buttonText: String = "OK"
//if (!msgDisp && allowNotifications){
if (!msgDisp){
do {
let querySnapshot = try await db.collection("AppInfo").getDocuments()
for document in querySnapshot.documents {
//print("\(document.documentID) => \(document.data())") ///// your code
if (document["MsgType"] as! String == "I"){
inf.Message = document["Message"] as! String
inf.MsgType = document["MsgType"] as! String
information.append(inf)
} else if (document["MsgType"] as! String == "B"){
buttonText = document["Message"] as! String
} else if (document["MsgType"] as! String == "Z"){
zipMsg = document["Message"] as! String
} else if (document["MsgType"] as! String == "V"){
curVers = document["Message"] as! String
let appVersion = Bundle.main.releaseVersionNumber
if (curVers != appVersion){
needUpdate = true
inf.Message = "DigiD has a more current version. Select Update App below to update Digid"
inf.MsgType = "I"
information.append(inf)
} else {
needUpdate = false
}
}
}
// show if allowNotifications OR needUpdate
if (information.count > 0 && (allowNotifications || needUpdate)) {
var msg: String = " "
for m in information{
msg = msg + "\(m.Message)\n\n"
}
let topController = topMostController()
let alert = UIAlertController(title: "DigiDeals Info", message: msg, preferredStyle: .alert)
//initialRun = true //for testing
alert.addAction(UIAlertAction(title: buttonText, style: .cancel, handler: { (action: UIAlertAction!) in
if (initialRun){
initialRun = false
__universal.popUpZipCode()__
}
//universal.showZipAlert(topController: topController!)
}))
if (needUpdate){
alert.addAction(UIAlertAction(title: "Update App", style: .default, handler: { (action: UIAlertAction!) in
if let url = URL(string: "itms-apps://apps.apple.com/us/app/digidealsus/id6499593438") {
UIApplication.shared.open(url)
}
//universal.showZipAlert(topController: topController!)
}))
}
** topController!.present(alert, animated: true)**
}
} catch {
print("Error getting documents: \(error)")
}
}