Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Unity3D saving data to ICloud

Discussion in 'iOS and tvOS' started by zaher_it, Oct 6, 2016.

  1. zaher_it

    zaher_it

    Joined:
    Oct 14, 2015
    Posts:
    5
    Hello.

    I am working on game project using Unity3D and I want to save (string or binary no problem) to icloud. I need it to implement game progress synchronization. I searched the web but I couldn't find a solution. I used google play services cloud and it was very easy to use. But when I began with data upload and download, I didn't know what to do.
    Any helps :)

    Thanks
     
  2. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Prime31 has an iCloud plugin.
     
  3. zaher_it

    zaher_it

    Joined:
    Oct 14, 2015
    Posts:
    5
    Thanks. I am looking for plugins.
    But I wonder if there is a solution like saving to google cloud. Simple and without plugins
     
  4. Kujo87

    Kujo87

    Joined:
    Sep 16, 2013
    Posts:
    160
  5. Stamblew

    Stamblew

    Joined:
    Sep 3, 2014
    Posts:
    22
    Any luck with iOS cloud storage? Google Play Games Service has their own solution, yet Apple has not provided anything like that so far =/
     
  6. shadowfork

    shadowfork

    Joined:
    Jan 8, 2010
    Posts:
    167
    Have you looked at this plugin:
    https://assetstore.unity.com/packag...ross-platform-native-plugins-ultra-pack-31086

    Particularly the cloud services. It has iCloud (iOS) and SavedGames (Android) support.

    Haven't tried it myself but I'm planning to use it on my next project.
    Let us know how it goes.
     
    Voxel-Busters likes this.
  7. DanarKayfi

    DanarKayfi

    Joined:
    Aug 27, 2012
    Posts:
    72
    I have been searching about the same thing! Any luck?
     
  8. zaher_it

    zaher_it

    Joined:
    Oct 14, 2015
    Posts:
    5
    We used a plugin from the asset store
     
  9. shadowfork

    shadowfork

    Joined:
    Jan 8, 2010
    Posts:
    167
    Which one did you go with exactly?
     
  10. juanpbol

    juanpbol

    Joined:
    Oct 22, 2017
    Posts:
    5
    Just wow... at least share the solution if you have found it. I mean, you came asking for help and yet you can't even provide the name of the plugin you used. I am actually researching on this same issue, without any luck so far.
     
    Tanek likes this.
  11. Tanek

    Tanek

    Joined:
    Apr 19, 2016
    Posts:
    45
    Anyone is willing to share anything useful about this topic?
    It just looks like that there is no documentation at all and no plugin from Apple for Unity integration, how am I supposed to make this work?
    I am of course willing to evaluate to use an asset store plugin if someone shares his/hers experience with it and if it can save me time but I don't want to use it as a "black box" without knowing what it does and knowing that with the proper plugin or documentation I could probably implement it by myself (as I did with Google Play Games integration for instance).
     
    Garrettec likes this.
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Did you check out the reviews for the mentioned asset? Good reviews for the most part. I often write the author to confirm the level of service, etc.
     
  13. Tanek

    Tanek

    Joined:
    Apr 19, 2016
    Posts:
    45
    Hi @JeffDUnity3D , thank you very much for your response.

    I checked the asset and yes, it's clearly a good asset.
    What bothers me is that there is no official Apple plugin for this integration and I don't want to use external assets as a "black box": I am an experienced developer and I'd like to understand how it works and what kind of integration it is using (surely native code from what I am discovering in these days).
    I know that the first part of my sentence probably should be taken to another "interested party", but IMHO it's very strange that there is no "official" way of integrating these key features.
     
    jaykorean and Garrettec like this.
  14. Garrettec

    Garrettec

    Joined:
    Nov 26, 2012
    Posts:
    96
    There are a lot of assets with cloud save functions, but all of them are multipurpose overloaded with tons of stuff and libraries. And what we (most of the developers) need is simple plugin for cloud saves. I've tried the only lightweight solution I found Play Game & Game Center Integration yesterday and it occurred that this is just a fraud, there is no Cloud Save inside as declared.
     
    newlife, Zimbres and Tanek like this.
  15. Stamblew

    Stamblew

    Joined:
    Sep 3, 2014
    Posts:
    22
    Please, could you, at least, provide the name of the plugin you are currently using for this purpose?
     
  16. wtfkeklol

    wtfkeklol

    Joined:
    Feb 9, 2016
    Posts:
    5
    2019.
    Still looking for a proper solution.
    Still no luck.
     
  17. Garrettec

    Garrettec

    Joined:
    Nov 26, 2012
    Posts:
    96
    True... What we did - we purchased one of the "big packages" (Easy Mobile, to be precise), and took library responsible for game services and code "talking" to this library. Slightly adjusted it to our needs and that's it. But I don't like this solution, because when cloud saves will change on Apple or Google side - probably we will need to reimplement it... Still better then nothing...
     
    Dawdlebird likes this.
  18. CSmochinaArnia

    CSmochinaArnia

    Joined:
    Feb 26, 2018
    Posts:
    7
    Well, for iOS, whatever is saved in the persistendatapath, is automatically synced to iCloud. if the user has an iCloud account setup. Unless the file is marked with UnityEngine.iOS.Device.SetNoBackupFlag
     
  19. Dark-1-Games

    Dark-1-Games

    Joined:
    Mar 26, 2014
    Posts:
    99
  20. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    324
    Amazing work, thanks for sharing it!
    One question though - how did you handle the entitlements for the iCloud capability and the iCloud container?
    Could you please send me an example 'entitlements.xml' file or something like that?
    Or did you use the ProjectCapabilityManager unity API for that? If so, how?

    Sorry for the intense questioning :)
     
  21. Dark-1-Games

    Dark-1-Games

    Joined:
    Mar 26, 2014
    Posts:
    99
    Hey,
    Sorry for not responding sooner, here's a sample entitlements file:

    Code (CSharp):
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    3. <plist version="1.0">
    4. <dict>
    5.     <key>com.apple.developer.icloud-container-identifiers</key>
    6.     <array>
    7.         <string>iCloud.$(CFBundleIdentifier)</string>
    8.     </array>
    9.     <key>com.apple.developer.icloud-services</key>
    10.     <array>
    11.         <string>CloudDocuments</string>
    12.     </array>
    13.     <key>com.apple.developer.ubiquity-container-identifiers</key>
    14.     <array>
    15.         <string>iCloud.$(CFBundleIdentifier)</string>
    16.     </array>
    17. </dict>
    18. </plist>
    19.  
    Handling entitlements is out of scope for this project, but is something we should totally do on DarkCPS (The project GKNativeExtensions was made for).
     
    Gooren likes this.
  22. sachinmok

    sachinmok

    Joined:
    Feb 25, 2019
    Posts:
    1
    I am working on game project using Unity3D and I want to save data to icloud. I need it to implement game progress synchronization. I searched the web but I couldn't find a solution.
    i cloud tutorial for unity
     
  23. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,834
  24. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    536
    I have a question about the cloud saving feature.
    Are players able to see the files inside? or tamper with them? we want to use it but we dont know how secure is this container, of course we will encrypt it anyway but still, does anyone know ?
    Thanks!
     
  25. GameEver

    GameEver

    Joined:
    Apr 28, 2020
    Posts:
    9
    Hi Garrettec, I'm experiencing the same as you and i think it's frustrating. Have you found a better solution? I'm about to buy the Easy Mobile Pro too...
     
  26. Garrettec

    Garrettec

    Joined:
    Nov 26, 2012
    Posts:
    96
    Year and a half ago we purchased one of the "big packages" (Easy Mobile, to be precise), and took library responsible for game services and code "talking" to this library. Slightly adjusted it to our needs. It was working for some time, but I couldn't say it was a pleasant experience stripping this huge monstrosity and adjusting the code. Later when building process for Android changed (new requirements from Google) we dropped synchronization and cloud save features in our games, because reapplying all our "adjustments" to updated Easy Mobile plugin didn't worth the efforts.

    So, unfortunately I don't know what to suggest you now :(
     
  27. GameEver

    GameEver

    Joined:
    Apr 28, 2020
    Posts:
    9
    Ok! Thank you.
    I think the Google Saved Games can be done with the official plugin from Google: https://github.com/playgameservices/play-games-plugin-for-unity without using the big packages, the problem is the iOS Cloud which hasn't got any official solution.
    I guess i will just go with the big package, it says it is modular and you can select only what you want to use, i will see if that's good.
     
  28. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    536
    iOS Cloud is a big black box full of bugs, sometimes saved games take 2 seconds to sync, sometimes 30 minutes, and there is no way to know the status of the sync... or if there's even something to sync...I think it might be a good solution for some apps, but for saving games that you might want to play on different devices it doesn't work too well...
    We just got headaches with this, still, we are using it since is the only free way to share the game between devices though, the plugin we use is the Stan's Assets IOS Native Pro.

    If someone got satisfying results using iCloud we would thank any advice on this matter. What we currently do is to combine Firebase with iCloud. But we would love to listen other approaches too.

    Good luck!
    pistoleta
     
    petediddy and Garrettec like this.
  29. GameEver

    GameEver

    Joined:
    Apr 28, 2020
    Posts:
    9
    If we get a good way in the future i will write back
     
    Garrettec and pistoleta like this.
  30. petediddy

    petediddy

    Joined:
    Mar 17, 2015
    Posts:
    19
    Hi @pistoleta would you be willing to share your code for using Stan's iOS Native Pro for this? We use their pro plugins for iOS and Android already and are trying to figure out how to use them for cloud save... any help would really be appreciated!
     
  31. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    536
    DM me
     
  32. nullObjectPtr

    nullObjectPtr

    Joined:
    Apr 16, 2013
    Posts:
    3
    Just wanted to notify the watchers on this thread that I've written a CloudKit plugin that should be able to help you with your save files. Using CloudKit directly can help you avoid a lot of the bugs that Game Center has with its save-system API. It works a lot better than the other popular options out there. I actually wrote it out of frustration from using the others. A handful of studios have already shipped games with it. Check it out! And don't hesitate to ask any questions if you need a hand with it.

    https://assetstore.unity.com/packages/tools/integration/hovelhouse-cloudkit-plugin-168227
     
    JohnnyFactor likes this.
  33. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    536
    wow, forgot about this old thread.
    I'm already using hovelhouse's plugin and totally recommend it. ;)
     
  34. huuhau

    huuhau

    Joined:
    Mar 28, 2014
    Posts:
    17
    Cool, if you posted it here 1-2 month ago I could have tried your plugin. I bought iOS Native Pro just to use iCloud save feature and it can't even built correctly in game :(
     
  35. nullObjectPtr

    nullObjectPtr

    Joined:
    Apr 16, 2013
    Posts:
    3
    Building for iOS once you have plugins involved can get tricky. Apple has a lot of hoops you have to jump through. What's the build problem you're having? I may be able to help.
     
  36. rahulnaik9010

    rahulnaik9010

    Joined:
    Jan 2, 2019
    Posts:
    19
    Can anyone provide a simple iCloud Save feature step by step without using plugins from asset store. I just need a simple key-value save to iCloud.Please help
     
  37. camillazi

    camillazi

    Joined:
    Sep 28, 2020
    Posts:
    5
    This plugin is no longer available. Any other recommendations? :(
     
  38. pistoleta

    pistoleta

    Joined:
    Sep 14, 2017
    Posts:
    536
    You still can use it, the repo is public. We are using it without problems.