IPv6 Crash Firebase Swift

时间:2016-11-08 04:12:31

标签: swift firebase ipv6 uialertcontroller

我有一个使用Firebase作为后端的Swift应用程序。

它在所有模拟器和我自己的iOS设备上运行得非常好,但是当我将它提交给Apple进行审核时,当审阅者点击UIButton呈现包含我的UIAlertController时,它就会崩溃内容报告机制:

@IBAction func moreActions(_ sender: AnyObject) {


    // 1
    let optionMenu = UIAlertController(title: nil, message: "Choose Action", preferredStyle: .actionSheet)

    // 2
    let reportPost = UIAlertAction(title: "Report this post", style: .default, handler: {
        (alert: UIAlertAction!) -> Void in
        self.report()
    })

    // 3
    let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: {
        (alert: UIAlertAction!) -> Void in
        print("Cancelled")
    })


    // 4
    optionMenu.addAction(reportPost)
    optionMenu.addAction(cancelAction)

    self.present(optionMenu, animated: true, completion: nil)


}

func report() {
    let messageView = MessageView.viewFromNib(layout: .CardView)
    var config = SwiftMessages.Config()
    config.dimMode = .gray(interactive: true)

    messageView.configureTheme(.info)
    messageView.button?.isHidden = true

    messageView.configureContent(title: "Thank you", body: "We have received your report, and will soon make all necessary actions.")
    SwiftMessages.show(config: config, view: messageView)

    ref = FIRDatabase.database().reference()
    ref.child("reportedPost").observeSingleEvent(of: .value, with: {(snapshot) in
        if snapshot.hasChild(self.passedPurchaseKey) {
            print("this post has been reported before")
            let targetKey = self.passedPurchaseKey
            let value = snapshot.childSnapshot(forPath: targetKey!).value as! Int
            let newValue = value + 1
            self.ref.child("reportedPost").updateChildValues([targetKey!: newValue])
        }else{
            print("this post has not been reported before")
            let targetKey = self.passedPurchaseKey
            self.ref.child("reportedPost").updateChildValues([targetKey!: 1])
        }
    })
}

审核人员建议崩溃可能是由于IPv6不兼容。我不能同意他们,因为上面的网络逻辑非常类似于我的其他应用程序,它没有导致任何崩溃。因此,我怀疑崩溃是由于其他原因造成的。

但我无法确定,因为我没有必要的硬件来在IPv6环境下测试我的应用程序。

提前感谢您的帮助!

//编辑1:添加了崩溃日志

crashlog_1

crashlog_2

0 个答案:

没有答案