Announcement

Collapse
No announcement yet.

ICloud Storage Working Basic Tutorial.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ICloud Storage Working Basic Tutorial.

    So I finally got ICloud working....here is a basic ICloud Storage tutorial for anyone who needs it, this will also fill in some gaps in the UDN doc's (UDK Nov2012 build):
    [*]Step One:(optional, you probably have done this already) Set your Apple developer account up with certificate.
    [*]step Two: Once your Apple developer account is setup, goto the Provisioning Potal and create an App ID.


    [*]Step Three: Open up the App Id you just created and check Enable for ICloud.



    you will get this message that basically states, if you already have a provison setup, you must delete and regenerate it to use the new App Id with Icloud enabled.


    create Provision using your new AppID, download the Provision and use with the iOS Configuration Wizard(Lots of information on the UDN about this):

    [*]Step four: Open UDK\UDK-2012-10\UDKGame\Config\Iphone\IPhoneEngine.ini, search for [PlatformInterface], now input the entries in bold below into your[PlatformInterface] section, I also placed it in IPhone-UDKEngine.ini just to be sure.

    CloudStorageInterfaceClassName=IPhoneDrv.CloudStor ageIPhone
    CloudStorageInterfaceFallbackClassName=IPhoneDrv.C loudStorageBaseIPhone
    LocalStorageInterfaceClassName=IPhoneDrv.LocalStor ageIPhone

    Code:
    [PlatformInterface]
    CloudStorageInterfaceClassName=IPhoneDrv.CloudStorageIPhone
    CloudStorageInterfaceFallbackClassName=IPhoneDrv.CloudStorageBaseIPhone
    LocalStorageInterfaceClassName=IPhoneDrv.LocalStorageIPhone
    FacebookIntegrationClassName=IPhoneDrv.FacebookIPhone
    InGameAdManagerClassName=IPhoneDrv.IPhoneAdManager
    MicroTransactionInterfaceClassName=IPhoneDrv.MicroTransactionIPhone
    AnalyticEventsInterfaceClassName=IPhoneDrv.FlurryAnalyticsIPhone
    TwitterIntegrationClassName=IPhoneDrv.TwitterIntegrationIPhone

    This assigns the correct interface for ICloud storage, by default it was setup to use only local storage(for storage emulation), now the function "Cloud = class'PlatformInterfaceBase'.static.GetCloudStorag eInterface();" returns CloudStorageIPhone_0 instead of CloudStorageBase_0. (Only on the device)

    [*]Step Five: Use Epics example CloudPC.uc to incorporate cloud storage into your current project, or use cloudgame.uc as a test game.

    [*]Step Six: Next we have to create an entitlements file to access the ubiquitous storage container, You can use XCode to generate one like I did, or If you haven't got a Mac, Just open notepad(or any plain text editor) and paste the XML doc below, fill in your own information, TeamID(can be found on Apple Developer account), Company name, and Game name.

    Paying close attention to the <key>com.apple.developer.ubiquity-container-identifiers</key> the last piece "Cloud Save Folder name" is what the Storage Folder on the cloud is called:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>application-identifier</key>
    	<string>"YourTeamID".com."CompanyName"."GameName"</string>
    	<key>com.apple.developer.ubiquity-container-identifiers</key>
    	<array>
    		<string>"YourTeamID".com."CompanyName"."Cloud Save Folder name"</string>
    	</array>
    	<key>com.apple.developer.ubiquity-kvstore-identifier</key>
    	<string>"YourTeamID".com."CompanyName"."GameName"</string>
    	<key>keychain-access-groups</key>
    	<array>
    		<string>"YourTeamID".com."CompanyName"."GameName"</string>
    	</array>
    </dict>
    </plist>
    Save as UDKGame.entitlements or whatever your UDK install name is(note:not your game name)e.g. "InstallName".entitlements, when your done the file should have the extension "ENTITLEMENTS File" in windows, place this file in UDK\UDK-2012-10\UDKGame\Build\iPhone, this folder should have your mobileprovision and your UDKGameOverrides.plist inside, if it doesn't you need to run iOS Configuration Wizard and import your mobile provision, and edit your Plist remembering the format used earlier, i.e. "Game Name", "Company Name"(reverse domain type).

    That should be it, I'm sure theres lots of little things to still work out, but the basic functionality is there.

    [*]Step Seven: Install using unreal Frontend(I dont think this will work exporting direct from the editor) use the settings:
    Code:
    UDKGame->IPhone->Test_32->ReleaseScript->Shipping_32
    this is so you can still use exec commands, when you run the game, once installed, tap four fingers onto the screen, then type "cloudgamefight" which should increment the Exp: and Gold variables, then type "cloudgamesave 1" exit the app and goto settings>Icloud>Storage & Backup>Manage Storage on your idevice, your game save will be in the Documents & Data under the folder name you used.

    I still need to solve why there isn't an app icon showing up in Icloud Documents & Data, but I have tested this on my Iphone5 and Ipad and the data syncs up between them nicely.

    let me know if you hit any problems, I may have left something out....

    #2
    Nice work, thank you for sharing! Will be using this tutorial

    Comment


      #3
      No problem, hope it helps.

      Will you post back if this works for you, sometimes the trouble with writing a tutorial is that only the creator can understand it, also it may need changing here and there to make things more clearer.

      Comment


        #4
        Thank you very much for this.

        Comment


          #5
          Favorited. Thanks!

          Comment


            #6
            i love you.

            Comment


              #7
              Thank you for posting this. This will be really useful.

              Comment


                #8
                Thanks for this. I've was trying to get cloud storage working for a while now..

                Comment


                  #9
                  This is pretty cool but how does it know what to save to iCloud or does that have to be set up seperately?

                  Comment


                    #10
                    Originally posted by Archerx View Post
                    This is pretty cool but how does it know what to save to iCloud or does that have to be set up seperately?
                    Sorry for such a late reply, I haven't logged on for a while, but yes you can save anything to iCloud, most examples of usage are covered on the UDN website so I didn't add it here, iCloud is a really nice feature when it's up and running, I.e. save games data backup, in app purchase data backup etc... The UDN just had several missing steps which hopefully are covered here.

                    Also you can play your game on your IPhone when out on the move, save the game and continue the game from your last save on an iPad or other idevice for example.

                    Comment


                      #11
                      First, thanks very much for this guide..it seems to be the only applicable information for implementing iCloud.

                      I have an AppID set up to work with iCloud, and my provisioning is using that AppID. Everything works fine when deploying to the device, and if I choose to BackUp my device to iCloud, the documents I saved are present in that backup under the application's name. But the data doesn't sync betweet devices nor does it show up in iCloud > Storage and Backup > Manage Storage > "Documents and Data".

                      I'm thinking my problems have to do with the "entitlemensts" file, because I can't get the file deployed. I continuously get the error:
                      Code:
                      Install \ Update of "UDKGame-IPhone-Release.ipa" failed with There is a problem with the entitlements for this application (0xE8008016) in 9.46 seconds
                      IPP ERROR: Failed to install IPA on device
                      [Jan 31, 6:32 PM] COMMANDLET 'iPhonePackager.exe deploy UDKGame Release' FAILED
                      my UDKGame.entitlements:
                      Code:
                      <?xml version="1.0" encoding="UTF-8"?>
                      <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
                      <plist version="1.0">
                      <dict>
                      	<key>application-identifier</key>
                      	<string>"MyTeamID".com."MyCompanyName"."MyGameName"</string>
                      	<key>com.apple.developer.ubiquity-container-identifiers</key>
                      	<array>
                      		<string>"YourTeamID".com."CompanyName"."MyGame"</string>
                      	</array>
                      	<key>com.apple.developer.ubiquity-kvstore-identifier</key>
                      	<string>"MyTeamID".com."MyCompanyName"."MyGameName"</string>
                      	<key>keychain-access-groups</key>
                      	<array>
                      		<string>"MyTeamID".com."MyCompanyName"."MyGameName"</string>
                      	</array>
                      </dict>
                      </plist>
                      Maybe a problem with my .plist overrides:
                      Code:
                      <key>CFBundleIdentifier</key> 
                      <string>MyTeamID.com.MyName.MyGame</string>
                      Have I missed something? I finally figured out provisioning and now this

                      Comment


                        #12
                        Solved everything, data shows up in iCloud > Storage and Backup > Manage Storage > "Documents and Data" now and syncs properly. It had something to do with the entitlements file that I copy/pasted from here.

                        After reading this, I cracked open my .mobileprovisioning and coppied the formatting. My UDKGame.entitlements now looks like this:
                        Code:
                        <?xml version="1.0" encoding="UTF-8"?>
                        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
                        <plist version="1.0">
                        	<dict>
                        		<key>application-identifier</key>
                        		<string>MyTeamID.com.MyCompany.MyGame</string>
                        		<key>com.apple.developer.ubiquity-container-identifiers</key>
                        		<array>
                        			<string>MyTeamID.com.MyCompany.MyGame</string>
                        		</array>
                        		<key>com.apple.developer.ubiquity-kvstore-identifier</key>
                        		<string>MyTeamID.com.MyCompany.MyGame</string>
                        		<key>get-task-allow</key>
                        		<true/>
                        		<key>keychain-access-groups</key>
                        		<array>
                        			<string>MyTeamID.com.MyCompany.MyGamel</string>
                        		</array>
                        	</dict>
                        </plist>

                        Comment


                          #13
                          I made my application Entitlements file with Xcode, Opened it up copied/pasted it here so I don't know how the formatting got so messed up, but I obviously removed my TeamID, Company Name, GameName, which needs to be replaced with yours..

                          No idea why it didn't work for you, although the entitlements code content you posted is more or less the same as the one in the tutorial besides the formatting, So I'm still perplexed, but i'm glad you have it working.

                          Although I have noted a potential issue when using ICloud, and I think the same thing happens with infinity blade 2, when you change or update the game to a new version it no longer recognises the saved files from a previous game version, but I'm doing tests at the minute...

                          Comment


                            #14
                            Hey Douglas, I hate to say it but i have no idea why it didn't work for me either. ALL of the threads I found with the error I was getting that actually had replies, just "started working", which seems to be the case for me. I'll try to explain my trouble shooting to anyone else looking to solve the same problem.

                            After enabling iCloud for your AppID, make sure you've set it as the AppID for your provisioning profile. The AppID should be in the form of:
                            Code:
                            YourTeamID.com.YourCompany.YourGame
                            Then make sure your .plist's BundleIdentifier is in the same form(last option in iOS Config Wizard):
                            Code:
                            YourTeamID.com.YourCompany.YourGame
                            Then your UDKGame.entitlements:
                            Code:
                            <?xml version="1.0" encoding="UTF-8"?>
                            <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
                            <plist version="1.0">
                            	<dict>
                            		<key>application-identifier</key>
                            		<string>YourTeamID.com.YourCompany.YourGame</string>
                            		<key>com.apple.developer.ubiquity-container-identifiers</key>
                            		<array>
                            			<string>YourTeamID.com.YourCompany.YourGame</string>
                            		</array>
                            		<key>com.apple.developer.ubiquity-kvstore-identifier</key>
                            		<string>YourTeamID.com.YourCompany.YourGame</string>
                            		<key>get-task-allow</key>
                            		<true/>
                            		<key>keychain-access-groups</key>
                            		<array>
                            			<string>YourTeamID.com.YourCompany.YourGame</string>
                            		</array>
                            	</dict>
                            </plist>
                            I have no idea if the formatting or one of the many trial/error attempts solved this for me. Again, thanks for this guide Douglas.

                            Comment


                              #15
                              works nice, Thanks for help.
                              another problem: Does anyone know how to set the icon showing in iCloud Storage "Document & Data"?

                              Comment

                              Working...
                              X