You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xcode开发App上架后Firestore添加订阅数据时崩溃求助

应用上线后添加订阅数据崩溃问题求助

我近期在App Store发布了一款应用,但自上线以来,所有用户在执行添加订阅数据操作时都会导致应用崩溃——该操作在测试阶段完全正常,我无法确定问题所在。

相关代码如下:

func addSubscriptionData(name: String, price: Double, category: Category, notes: String, theme: String, dateSignedUp: String, billingPeriod: Int, reminder: Bool, daysBefore: Int) {
    let db = Firestore.firestore()
    
    db.collection("users").document(preferences.docId).collection("subscriptions").addDocument(data: ["name": name, "price": price, "category": category.rawValue, "notes": notes, "theme": theme, "dateSignedUp": dateSignedUp, "billingPeriod": billingPeriod, "reminder": reminder, "daysBefore": daysBefore]) { error in
        if error == nil {
            self.getSubscriptions()
        }
        else{
            print("Can't add subscription to database")
        }
    }
}

附上崩溃日志截图:
崩溃日志截图1
崩溃日志截图2
崩溃日志截图3

感谢您的帮助!

内容的提问来源于stack exchange,提问作者Cian B

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.03 22:00:59