在连接到IPv6的运行iOS 9.3.5的iPad和iPhone上应用程序崩溃

在连接到IPv6的运行iOS 9.3.5的iPad和iPhone上应用程序崩溃,ios,swift,core-data,alamofire,magicalrecord,Ios,Swift,Core Data,Alamofire,Magicalrecord,我对应用商店评论有问题。我从应用商店收到这些消息。 第一次审查 “当我们输入Instagram帐户信息时,您的应用程序在运行iOS 9.3.5并连接到IPv6网络的iPad和iPhone上崩溃。” 第二次审查 “当我们输入Instagram帐户信息时,您的应用程序在运行iOS 9.3.5并连接到IPv6网络的iPad和iPhone上崩溃。 使用应用程序时发生此情况:脱机“ 在我的应用程序中,我使用Alamofire和Alamofire对象映射器。我在uiwebview中发送请求,然后等待获取带有

我对应用商店评论有问题。我从应用商店收到这些消息。 第一次审查 “当我们输入Instagram帐户信息时,您的应用程序在运行iOS 9.3.5并连接到IPv6网络的iPad和iPhone上崩溃。”

第二次审查 “当我们输入Instagram帐户信息时,您的应用程序在运行iOS 9.3.5并连接到IPv6网络的iPad和iPhone上崩溃。 使用应用程序时发生此情况:脱机“

在我的应用程序中,我使用Alamofire和Alamofire对象映射器。我在uiwebview中发送请求,然后等待获取带有访问令牌的url,然后用MagicalRecords保存核心数据。在我的设备上,我没有崩溃

所以我的代码中处理访问令牌上的url的部分

    guard let url = url else {
        return nil
    }

    if !isRedirectURL(url) {
        return nil
    }

    let components = url.absoluteString.componentsSeparatedByString("=")
    if components.count == 2 {
        return components.last
    }
    else {
        return nil
    }
所以我检查url是重定向还是否,appRedirectURL-它是Instagram Api的重定向url

    guard let appRedirectURL = NSURL(string: appRedirectURL) else {
        return false
    }

    //check if both urls have host
    guard let host = appRedirectURL.host, urlHost = url.host else {
        return false
    }

    return appRedirectURL.scheme == url.scheme && host == urlHost 
节省

起初,我尝试使用教程在我的mac上设置ipv6

但就我而言,我是这样做的:

  • 我连接了我的第一部iPhone,并在上面通过usb设置了个人热点
  • 使用其他设备上的NAT64从我的mac共享Internet
  • 检查第二台设备上的所有内容 但我的设备上没有ipv6,这是个人热点,只有ipv4。也许,这就是问题所在,我应该在第一台设备上同时支持这两种功能

    所以,我也有来自crashlytics的CrashLog,但它们非常奇怪,它们表明我在CoreData中有问题

  • 0x1001dce94 CoreDataManager。(更新InstallAgramAccount(InstagramUser,完成:(Bool,NSError?->()?)->())。(闭包#1)(CoreDataManager.swift:82)
  • MagicalRecord 0x1006b9408[MagicalRecord(Actions)saveWithBlock:completion:][U block\U invoke(MagicalRecord+Actions.m:33)
  • CoreData 0x184fa508c开发人员SubmittedBlocktonsManagedObjectContextPerform+196
  • libdispatch.dylib 0x182af147c_dispatch_client_callout+16
  • libdispatch.dylib 0x182afd4c0 _调度_队列_排水+864
  • libdispatch.dylib 0x182af4f80 _dispatch_queue_invoke+464
  • 这是我的第一个函数

    func updateInstagramAccount(account: InstagramUser, completion: CoreDataSuccessBlock?) {
        CoreDataManager.sharedInstance.save({ (savingContext) in
            if let objectId = account.objectId, instagramAccount = InstagramAccount.createIfNeededWhereKey(InstagramAccount.Attributes.instagramId, equalTo: objectId, context: savingContext) as? InstagramAccount {
    
                instagramAccount.username = account.username
                instagramAccount.fullName = account.fullName
                instagramAccount.profilePictureURLPath = account.profilePictureURL?.absoluteString
                instagramAccount.website = account.website?.absoluteString
                instagramAccount.bio = account.bio
                instagramAccount.customizedBio = account.bio
    
                if let follows = account.counts?.follows, followedBy = account.counts?.followedBy, media = account.counts?.media {
                    instagramAccount.followsCount = Int16(follows)
                    instagramAccount.followedByCount = Int16(followedBy)
                    instagramAccount.mediaCount = Int16(media)
                }
                instagramAccount.objectId = account.objectId
            }
        }) { (success, error) in
            completion?(success, error)
        }
    }
    
    我知道ipv6对InstagramUser对象的映射是错误的,但我不知道具体情况,也无法检查

    你能问下几个问题吗

  • 如果我与Nat64共享网络,我是否应该在第一台设备上建立ipv6连接以检查第二台设备上的ipv6
  • 为什么我在CoreData中出错,而不是UIWebView委托方法
  • 你能提出什么建议来解决它
  • 更新 我得到了这个url来处理访问令牌


    在ipv6上,可能会出现以下情况:我将获得不同的url?

    ipv6信息是一种误导。实际问题是,正如第二次审查的消息中所述,使用你的应用程序“离线”。是的,我在“离线”中尝试过,我关闭了3g、wifi并设置了机场模式,结果uiwebview无法加载授权url,但应用程序中没有崩溃。嘿,你是否发现了这个问题,因为我的应用程序也被拒绝了。IPv6信息是一个骗局。实际的问题是使用你的应用程序“离线”,如关于第二次审查的消息中所述。是的,我在“离线”中尝试过,我关闭了3g、wifi并设置了机场模式,结果uiwebview无法加载授权url,但应用程序中没有崩溃。嘿,你确定了这个问题,因为我的应用程序也被拒绝了。