Flutter 建立 iOS 專案遇到 Missing Purpose String in Info.plist 問題

使用 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 上架流程:

发布的IOS版APP – Flutter中文网
本文介绍了如何构建Flutter的IOS发布版,并将其发布到App Store或TestFlight。

參考這兩個鏈結:

iOS macro not working with new Flutter 1.20.0 Podfile · Issue #358 · …
? Bug Report After upgrading to Flutter 1.20.0 beta a new Podfile needs to be generated (flutter/flutter#45197). Afterwards I added the configuration to the Podfile but it is not taking effect. I r…

主要就是要把不需要的權限給關掉才行,如果有用這個套件的話要特別注意。
注意 Profile 更新過後,要把 Profile.lock 刪除再重新 pod install 一次。

Update 權限參考:


已發佈

分類:

作者: