標籤: flutter

  • iOS 權限提示(Protected Resources)

    在 iOS 的二進制檔案上傳之後,有時會有關於 Missing Purpose String in Info.plist  的錯誤,參考這個鏈結會發現需要在 info.plist 中添加說明的字串,這裡列表一份,以後可以直接使用。

    <key>NSSpeechRecognitionUsageDescription</key>
    <string>App需要您的同意,才能訪問語音識別</string>
    <key>NSAppleMusicUsageDescription</key>
    <string>App需要您的同意,才能訪問媒體資料庫</string>
    <key>NSBluetoothPeripheralUsageDescription</key>
    <string>App需要您的同意,才能訪問藍牙</string>
    <key>NSCalendarsUsageDescription</key>
    <string>App需要您的同意,才能訪問日曆</string>
    <key>NSCameraUsageDescription</key>
    <string>App需要您的同意,才能訪問相冊</string>
    <key>NSContactsUsageDescription</key>
    <string>App需要您的同意,才能訪問通信錄</string>
    <key>NSHealthShareUsageDescription</key>
    <string>App需要您的同意,才能訪問健康分享</string>
    <key>NSHealthUpdateUsageDescription</key>
    <string>App需要您的同意,才能訪問健康更新</string>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>App需要您的同意,才能始終訪問位置</string>
    <key>NSLocationUsageDescription</key>
    <string>App需要您的同意,才能訪問位置</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>App需要您的同意,才能在使用期間訪問位置</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>App需要您的同意,才能訪問麥克風</string>
    <key>NSMotionUsageDescription</key>
    <string>App需要您的同意,才能訪問運動與健身</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>App需要您的同意,才能訪問相機</string>
    <key>NSRemindersUsageDescription</key>
    <string>App需要您的同意,才能訪問提醒事項</string>
  • Flutter 開發環境設定(影片)

    筆記一下,避免以後換新電腦都忘記這種三百年才會設定一次的開發環境。

  • 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 權限參考:

  • Flutter 在 Mac 上安裝錯誤的解決方法

    最近在摸 Flutter 的專案,在 Mac 環境下一直裝不起來,先姑且不抱怨 Android Studio 在 MacOS 更新後突然跑超慢的,Flutter 安裝時似乎是抓不到 Android 設定檔案的位置,導致:

    [✓] Android Studio (version 3.1)
        ✗ Flutter plugin not installed; this adds Flutter specific functionality.
        ✗ Dart plugin not installed; this adds Dart specific functionality.

    一直出現類似的錯誤。後來參考鏈結

    Safe fix for Mac (Android studio 4.1+) It is in a different directory now, but symlink helps.
    Just run in the Terminal this command:

    ln -s ~/Library/Application\ Support/Google/AndroidStudio4.1/plugins ~/Library/Application\ Support/AndroidStudio4.1

    記得路徑換成正確的,此時是 AndroidStudio4.1
    soft link 建立起來以後就正確啦!

    筆記一下 Flutter 使用的 Dart 程式語言資料,找不到快速索引的文件,如果有找到再放上來。

    Day 1:為什麼要用 Flutter ? – iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天
    本篇文章同步發表在 HKT 線上教室 部落格,線上影音教學課程已上架至 Udemy-HKT線上教室。想追蹤更多相關技術資訊,歡迎到 臉書粉絲專頁 …