Open disonwei opened 10 months ago
You need to enable iCloud Drive in iCloud, rather than the apps using iCloud.
Add this in your info.plist file.
<key>NSUbiquitousContainers</key>
<dict>
<key>iCloud.com.example.MyApp</key>
<dict>
<key>NSUbiquitousContainerIsDocumentScopePublic</key>
<true/>
<key>NSUbiquitousContainerSupportedFolderLevels</key>
<string>Any</string>
<key>NSUbiquitousContainerName</key>
<string>MyApp</string>
</dict>
</dict>
I am assuming, you configure container and apple signing correctly.
[✓] Flutter (Channel stable, 3.16.8, on macOS 14.1.2 23B92 darwin-arm64, locale zh-Hans-US) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] Android Studio (version 2022.3) [✓] VS Code (version 1.85.2) [✓] Connected device (4 available) [✓] Network resources
I am testing on a real iOS device with iOS version 17.2. I have installed instructions to configure iCloud in Xcode, checked Key-value storage, iCloud Documents, and CloudKit, and selected Containers. I also called the ContainersID in the code. However, an error is being prompted
PlatformException(E_CTR, Invalid containerId, or user is not signed in, or user disabled iCloud permission, null, null)