1. 程式人生 > >蘋果稽核之遇到IPV6問題被拒的解決方法

蘋果稽核之遇到IPV6問題被拒的解決方法

  • 情景:

  等待蘋果稽核上線時,發現因為IPV6被拒了。這是悲劇,以下是蘋果稽核給我的理由:

We discovered one or more bugs in your app when reviewed on iPad running iOS 11.4.1 on Wi-Fi connected to an IPv6 network.

Specifically, your app displayed an error message upon launch.

Next Steps

To resolve this issue, please run your app on a device to identify any issues, then revise and resubmit your app for
review.

If we misunderstood the intended behavior of your app, please reply to this message in Resolution Center to provide information on how these features were intended to work.

For new apps, uninstall all previous versions of your app from a device, then install and follow the steps to reproduce the issue. For updates, install the new
version as an update to the previous version, then follow the steps to reproduce the issue.

Resources

For information about testing your app and preparing it for review, please see Technical Note TN2431: App Testing Guide. 

For a networking overview, please review About Networking. For a more specific overview of App Review’s IPv6 requirements, please review the IPv6 and App Review discussion on the Apple Developer Forum.

Please see attached screenshot for
details.


  還附了一張圖:

  • 思考與排查:

     用自己的網路請求是沒有任何問題的,但是到了蘋果稽核就提示網路問題;但是,首頁的資料已經出來了,這個說明,其實介面在ipv6的情況下是可以呼叫的,排除連結不上ipv6網路的問題。那麼這個網路請求失敗是哪裡來的呢?

     與朋友幾番討論,可能存在這樣的問題:就是在申請網路使用許可權之前,就開始走網路請求了,因此在申請網路使用許可權之前的藉口會被拒,導致介面請求失敗。

  • 解決方法:

  順著這個思路,做了一個投機取巧的方法,就是在appdelegate的didFinishLauch方法裡面,先呼叫一個不相干的介面,比如“百度”,這樣第一個申請網路請求的介面不通過也不會導致程式其他的相關介面。

  • 程式碼如下:

第一步:宣告一個呼叫百度請求的方法 

第二步:在appdelegate呼叫這個方法

  按照這個修改,重新提交了一個版本,第二天稽核就通過了。

  此方法僅供參考,望遇到類似問題的隊友們能有所幫助。