iOS 12.4.1版本因苹果商店拒绝ipad设备而崩溃

问题描述 投票:0回答:1

你好,我是IOS Swift的新手,

我的应用程序可以在iPhone / iPad模拟器上正常运行,但是,我从苹果应用程序商店收到了应用程序拒绝消息。

我相信崩溃原因是调用api,因为根据拒绝消息,他们试图使用电子邮件和密码登录,一旦他们点击了提交按钮,该应用就会崩溃,点击提交按钮的应用被称为登录API。

苹果崩溃报告

{"app_name":"gogetGONE","timestamp":"2019-09-24 13:37:46.50 -07
    00","app_version":"6.0","slice_uuid":"5958bf7b-689e-306b-8b81-0ad61cdb32b2","adam_id":1466582359,"build_version":"1","bundleID":"com.gogetgone.gogetgonepro","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 12.4.1 (16G102)","incident_id":"D1DE09EF-3CC3-47C8-A03B-49108C8B3BFC","name":"gogetGONE"}
    Incident Identifier: D1DE09EF-3CC3-47C8-A03B-49108C8B3BFC
    CrashReporter Key:   c201dc074338fd6214efc8c4bfbbe19377d79d89
    Hardware Model:      xxx
    Process:             gogetGONE [4259]
    Path:                /private/var/containers/Bundle/Application/E7D0CB5E-929F-43F5-AEA9-400B122CD35E/gogetGONE.app/gogetGONE
    Identifier:          com.gogetgone.gogetgonepro
    Version:             1 (6.0)
    AppStoreTools:       11A1002b
    Code Type:           ARM-64 (Native)
    Role:                Non UI
    Parent Process:      launchd [1]
    Coalition:           com.gogetgone.gogetgonepro [1698]


    Date/Time:           2019-09-24 13:37:46.3466 -0700
    Launch Time:         2019-09-24 13:20:36.4938 -0700
    OS Version:          iPhone OS 12.4.1 (16G102)
    Report Version:      104

    Exception Type:  EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000001, 0x0000000102e50348
    Termination Signal: Trace/BPT trap: 5
    Termination Reason: Namespace SIGNAL, Code 0x5
    Terminating Process: exc handler [4259]
    Triggered by Thread:  0

    Thread 0 name:  Dispatch queue: com.apple.main-thread
    Thread 0 Crashed:
    0   gogetGONE                       0x0000000102e50348 0x102df8000 + 361288
    1   gogetGONE                       0x0000000102e1c1f0 0x102df8000 + 147952
    2   Alamofire                       0x0000000102f4a920 0x102f1c000 + 190752
    3   Alamofire                       0x0000000102f2d074 0x102f1c000 + 69748
    4   libdispatch.dylib               0x0000000182983a38 0x182924000 + 391736
    5   libdispatch.dylib               0x00000001829847d4 0x182924000 + 395220
    6   libdispatch.dylib               0x0000000182932008 0x182924000 + 57352
    7   CoreFoundation                  0x0000000182ed732c 0x182e2d000 + 697132
    8   CoreFoundation                  0x0000000182ed2264 0x182e2d000 + 676452
    9   CoreFoundation                  0x0000000182ed17c0 0x182e2d000 + 673728
    10  GraphicsServices                0x00000001850d279c 0x1850c8000 + 42908
    11  UIKitCore                       0x00000001af5c4c38 0x1aed08000 + 9161784
    12  gogetGONE                       0x0000000102dff9f4 0x102df8000 + 31220
    13  libdyld.dylib                   0x00000001829958e0 0x182994000 + 6368

代码段摘要的Info.plist。

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSExceptionDomains</key>
    <dict>
        <key>localhost</key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>

Login.swift

func save() {
    let parameters: Parameters = [
        "email": self.emailTextField.text!,
        "password": self.passwordTextField.text!,
    ]
    loginButton.isEnabled = false
    Alamofire.request(ApiRequest.API_URL+"/auth/login", method : .post,parameters:parameters).responseJSON { response in
        if((response.result.value) != nil) {
            let json = JSON( response.result.value!)
            print("JSON: \(json)") // serialized json response
            if(json["success"].boolValue){
                //TODO login login
                self.gotoHome()
            }
            else{
                self.showAlert(for: json["message"].stringValue)
            }
        }
    }

}
ios swift iphone alamofire appstore-approval
1个回答
0
投票

据我所知,它可能是零响应,或者类型转换导致了这个问题。

  • 首先替换

        if((response.result.value) != nil)
    

    if let swiftyResponse=response, swiftyResponse.result.value !=nil { 
     guard let json = swiftyResponse.result.value else{return }}
    
  • 进一步验证json["success"].boolValue实际返回布尔值或成功包含字符串或整数等。

  • 更多检查self.gotoHome方法,我建议您也将其发布到您的代码中

© www.soinside.com 2019 - 2024. All rights reserved.