Simple Mobile Cloud Save Helper
Get the asset on the Unity Asset Store!
I made Simple Mobile Cloud Save Helper to help you integrate Apple CloudKit’s basic functionality into your game. The plugin provides a simple API for writing, modifying, and deleting data in the user’s CloudKit database.
The native portion is written in SWIFT and the Unity’s side is of course written in C#. All the methods on the C# side are well documented and are ready to use.
Supported platforms:
- iOS
- macOS
- tvOS
- visionOS (at least when built as iOS)
Supported operations:
- Creating a record
- Deleting a record
- Updating a record
- Fetching a record
- Creating a zone
- Deleting a zone
- Doing all of the above operations in private or public database of your app
An example of a method from Simple Mobile Cloud Save Helper:
/// <summary>
/// Fetches a record from the specified CloudKit zone with the given record ID.
/// </summary>
/// <param name="recordID">A unique record ID for the requested record. Note that 2 different records can have the same ID only if they exist in 2 different zones.</param>
/// <param name="zoneId">Which zone to fetch the record from. If none provided, the default zone will be used.</param>
/// <param name="onOperationFinished">A callback for when the operation finishes successfully or fails.</param>
public void FetchCloudKitRecord(string recordID, string zoneId, Action<CloudKitOperationResult> onOperationFinished)
Simple Mobile Cloud Save Helper provides a demo prefab with all the functionality hooked up to test your CloudKit support right away.
For the moment the plugin supports this specific subset of operations, which should be enough for most games. If you like the plugin and would like to see more functionality, let me know through the contact page!