使用 Flutter 建立 iOS release 專案時,如果上傳失敗會得到一封檢測錯誤的信件,其中有一個錯誤是 Missing Purpose String in Info.plist ,裡面會有
Your app’s code references one or more APIs that access sensitive user data. The app’s Info.plist file should contain a NSContactsUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. If you’re using external libraries or SDKs, they may reference APIs ….
你會在你註冊的信箱中收到錯誤的信件
關鍵字是 NSContactsUsageDescription ,表示缺乏要求權限的文字訊息。而在 info.plist 添加要求資訊以後還是會有錯,才發現是因為使用 permission_handler 這個 dart 套件,他需要一些額外設定。
先放一下 Flutter 的 iOS 上架流程:
參考這兩個鏈結:
主要就是要把不需要的權限給關掉才行,如果有用這個套件的話要特別注意。
注意 Profile 更新過後,要把 Profile.lock 刪除再重新 pod install 一次。
Update 權限參考: